Google App Engine后端servlet无响应 [英] Google App Engine backend servlet not responding
本文介绍了Google App Engine后端servlet无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我构建了一个我试图在后端运行的servlet。但是在启动后端并将邮件发送至 http://mybackend.myapp.appspot.com/update 没有任何内容。
当我访问时: http://myapp.appspot.com / update 该servlet正在工作,但不在后端。
我在做什么错了?
Servlet代码:
public class UpdateServlet继承HttpServlet
{
@Override
protected void doPost (HttpServletRequest req,HttpServletResponse resp)抛出ServletException异常,IOException
{
System.out.println(start long task);
}
}
backends.xml
<后端>
< backend name =mybackend>
< class> B1< / class>
< options>
< dynamic> true< / dynamic>
< public> true< / public>
< / options>
< / backend>
< / backends>
web.xml
< servlet>
< servlet-name>更新< / servlet-name>
< servlet-class> server.UpdateServlet< / servlet-class>
< / servlet>
< servlet-mapping>
< servlet-name>更新< / servlet-name>
< url-pattern> / update< / url-pattern>
< / servlet-mapping>
解决方案 发送HTTP 302重定向
http://my-life.appspot.com
。所以这是你的代码。 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>
解决方案
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.
这篇关于Google App Engine后端servlet无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文