How to use two servlets in web.xml

hi everybody,

i want to use the ikaruswidget-addon from the add-on director(https://vaadin.com/directory#addon/ikaruswidget). the demo-code uses in the web.xml another servlet class as the default vaadin servlet (com.vaadin.terminal.gwt.server.ApplicationServlet)

is there a way to define both of them in my web.xml?

my web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>Vaadin Web Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
         <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
       
        <init-param>
            <description>Vaadin application class to start</description>
            <param-name>application</param-name>
            <param-value>myclass</param-value>
        </init-param>
        <init-param>
            <param-name>widgetset</param-name>
            <param-value>mywidgetset</param-value>
        </init-param>
   </servlet>

    
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    
</web-app>

and here the web.xml from the example


<?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">
    <display-name>IkarusWidgetDemo</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>IkarusWidgetDemo Application</servlet-name>
        <servlet-class>com.velociti.ikarus.ui.widget.demo.servlet.JQueryServlet</servlet-class>
        <init-param>
            <description>Vaadin application class to start</description>
            <param-name>application</param-name>
            <param-value>com.velociti.ikarus.ui.widget.demo.IkarusWidgetDemo</param-value>
        </init-param>
        <init-param>
            <description>Application widgetset</description>
            <param-name>widgetset</param-name>
            <param-value>com.velociti.ikarus.widget.demo.IkaruswidgetdemoWidgetset</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>IkarusWidgetDemo Application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>


I don’t quite understand why you want to have another servlet to use the add-on.

The add-on contains a library, which you use either by downloading it or defining as a dependency. The widgets need to be compiled to your project widget set. You don’t need a separate servlet to use it. See
Installation of add-ons
in BoV.

(You probably don’t need it in your case, but mapping multiple servlets is described
here
.)

hmm but if i use the

<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class> servlet-class, the sliding panel isn´t opening :frowning:

but if i use the <servlet-class>mypath.SlidingPanel.servlet.JQueryServlet</servlet-class> it is opening but there are a lot of missing vaadin files

any idea?