简体   繁体   English

Google App Engine后端servlet没有响应

[英]Google App Engine backend servlet not responding

I built a servlet that I'm trying to run in the backend. 我建立了一个要在后端运行的servlet。 But after starting the the backend and sending post message to http://mybackend.myapp.appspot.com/update nothing is appening. 但是在启动后端并将帖子消息发送到http://mybackend.myapp.appspot.com/update之后,没有任何反应。
when I access: http://myapp.appspot.com/update the servlet is working but not in backend. 当我访问: http : //myapp.appspot.com/update时 ,servlet正在工作,但在后端不工作。
What am I doing wrong? 我究竟做错了什么?

Servlet code: Servlet代码:

public class UpdateServlet extends HttpServlet
{   
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException 
    {
        System.out.println("start long task");              
    }
}

backends.xml backends.xml

<backends>
  <backend name="mybackend">
    <class>B1</class>
    <options>
      <dynamic>true</dynamic>
      <public>true</public>
    </options>
  </backend>
</backends>

web.xml web.xml

<servlet>
    <servlet-name>update</servlet-name>
    <servlet-class>server.UpdateServlet</servlet-class> 
</servlet>

<servlet-mapping>
    <servlet-name>update</servlet-name>
    <url-pattern>/update</url-pattern>
</servlet-mapping>

The servlet at http://mybackend.myapp.appspot.com/update sends a HTTP 302 redirect http://my-life.appspot.com . 位于http://mybackend.myapp.appspot.com/update的servlet发送HTTP 302重定向http://my-life.appspot.com So it's your code that's doing it. 因此,这是您的代码完成的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM