/** * Creates a vaadin servlet service. * * @param deploymentConfiguration * the deployment configuration to be used * * @return the created vaadin servlet service * * @throws ServiceException * if creating the vaadin servlet service fails * * @since 7.0.0 */ protected VaadinServletService createServletService( DeploymentConfiguration deploymentConfiguration) throws ServiceException { VaadinServletService service = new VaadinServletService(this, deploymentConfiguration); service.init(); return service; }
protected VaadinServletService createServletService( DeploymentConfiguration deploymentConfiguration) throws ServiceException { VaadinServletService service = new VaadinServletService(this, deploymentConfiguration); service.init(); return service; }
public class MyVaadinServlet extends VaadinServlet{ @Override protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException { VaadinServletService service = new VaadinServletService(this, deploymentConfiguration){ @Override protected List<RequestHandler> createRequestHandlers() throws ServiceException { List<RequestHandler> handlers = super.createRequestHandlers(); handlers.add((session, request, response) -> { // HERE GOES THE CODE return false; }); return handlers; } }; service.init(); return service; } }
MyDeploymentConfiguration deploymentConfiguration = new MyDeploymentConfiguration(MyVaadinServlet.class, new Properties()); VaadinServletService vaadinService = new VaadinServletService(vaadinServlet, deploymentConfiguration); VaadinServletRequest vaadinRequest = new VaadinServletRequest(new MockHttpServletRequest(), vaadinService);