Google App Engine backend servlet not responding

╄→гoц情女王★ 提交于 2019-12-08 05:42:10

问题


I built a servlet that I'm trying to run in the backend. But after starting the the backend and sending post message to http://mybackend.myapp.appspot.com/update nothing is appening.
when I access: http://myapp.appspot.com/update the servlet is working but not in backend.
What am I doing wrong?

Servlet code:

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>
  <backend name="mybackend">
    <class>B1</class>
    <options>
      <dynamic>true</dynamic>
      <public>true</public>
    </options>
  </backend>
</backends>

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>

回答1:


The servlet at http://mybackend.myapp.appspot.com/update sends a HTTP 302 redirect http://my-life.appspot.com. So it's your code that's doing it.



来源:https://stackoverflow.com/questions/12921874/google-app-engine-backend-servlet-not-responding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!