使用注释方法的 Gwt 控制器
我已经通过实现名为的控制器将 GWT 与 Spring MVC 集成 通过 DispatcherServlet 使用 SimpleUrlHandlerMapping。
public class GwtRpcController extends RemoteServiceServlet implements Controller, ServletContextAware { @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { super.doPost(request, response); return null; } }
我想使用带有注释@Controller
的新方法,如下所示:
@Controller public class GwtRpcController extends RemoteServiceServlet implements ServletContextAware { }
在这种情况下,将没有handleRequest方法,我应该在哪里执行super.doPost(request, response);< /代码>?
I already integrated GWT with Spring MVC by implementing the Controller which is called
by DispatcherServlet using SimpleUrlHandlerMapping.
public class GwtRpcController extends RemoteServiceServlet implements Controller, ServletContextAware { @Override public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { super.doPost(request, response); return null; } }
I want to use the new approach with the annotation @Controller
, like below:
@Controller public class GwtRpcController extends RemoteServiceServlet implements ServletContextAware { }
In this case there will be no handleRequest method, where should I do super.doPost(request, response);
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅 spring 2.5 中的带注释的 Web mvc 控制器
您不应该手动执行 doPost/doGet,只需定义控制器方法以及相应的参数、返回值和 url 映射的注释即可。
See annotated web mvc controllers in spring 2.5
You should not to do doPost/doGet manually, just define controller method with corresponding parameters, return value and annonations for url mapping.