0

I have a Vaadin application which uses ru.xpoft.vaadin.SpringVaadinServlet as its single servlet. Now I am trying to change the servlet class to com.vaadin.spring.server.SpringVaadinServlet.

But I don't know how to specify the UI class for com.vaadin.spring.server.SpringVaadinServlet inside web.xml. I know it is possible to specify the servlet and UI class without a web.xml(Using @WebServlet and @VaadinServletConfiguration annotations). But still I require to configure the servlet using web.xml.

Please help.

AJA
  • 456
  • 3
  • 12

1 Answers1

1

You can spedify servlet and UI like this in the web.xml (from the Vaadin 7 Documentation):

<?xml version="1.0" encoding="UTF-8"?>
<web-app
  id="WebApp_ID" version="2.4"
  xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <servlet>
    <servlet-name>myservlet</servlet-name>
    <servlet-class>
        com.vaadin.server.VaadinServlet
    </servlet-class>

    <init-param>
      <param-name>UI</param-name>
      <param-value>com.ex.myprj.MyUI</param-value>
    </init-param>

    <!-- If not using the default widget set-->
    <init-param>
      <param-name>widgetset</param-name>
      <param-value>com.ex.myprj.AppWidgetSet</param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>myservlet</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>

See also the Vaadin docs about Deploying an Application.

Axel Meier
  • 1,105
  • 2
  • 18
  • 28