【发布时间】:2014-07-29 09:07:53
【问题描述】:
我使用 Vaadin 7。我想更改我的应用程序中的默认 Servlet。我所做的是以下内容:
public class MyVaadinApplication extends UI {
@WebServlet(urlPatterns = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = true, ui = MyVaadinApplication.class)
public static class Servlet extends VaadinServlet {
@Override
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
/*
* Vaadin SessionListener
*/
getService().addSessionInitListener(new VaadinSessionListener.VaadinSessionInitListener());
getService().addSessionDestroyListener(new VaadinSessionListener.VaadinSessionDestroyListener());
}
}
....
它不考虑新的 servlet。我试图删除 Web.xml,但出现错误。 如何替换 web.xml 中的 Servlet?
【问题讨论】: