使用注释方法的 Gwt 控制器

发布于 2025-01-03 07:35:22 字数 710 浏览 4 评论 0原文

我已经通过实现名为的控制器将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空名 2025-01-10 07:35:22

请参阅 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文