web.xml - no change to servlet under test

16 views
Skip to first unread message

Sergiu Ivanesi

unread,
May 13, 2014, 6:35:21 AM5/13/14
to gwtrpcc...@googlegroups.com
I'm trying to configure the following option for my example, but it doesn't work for me:

"

Option 1

Create an instance of GwtRpcCommLayerServlet in your web.xml file. Specify your own servlet as an initialization parameter:

<servlet> <servlet-name>GwtRpcCommLayerServlet</servlet-name> <servlet-class>gwtrpccommlayer.server.GwtRpcCommLayerServlet</servlet-class> <init-param> <param-name>GwtRpcCommLayerServletImplClass</param-name> <param-value>example.server.GreetingServiceImpl</param-value> </init-param> </servlet>

Choose option 1 if you don't want to alter your servlet classes.


"

Do you have an workable example when using a separate servlet in web.xml file?
It only works for me when extending the servlet under test, but not when using a separate one.

Below is my web.xml file:

<web-app>

    <!-- Servlets -->
    <servlet>
        <servlet-name>greetServlet</servlet-name>
        <servlet-class>example.server.GreetingServiceImpl</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>greetServlet</servlet-name>
        <url-pattern>/example/greet</url-pattern>
    </servlet-mapping>


    <!-- Copy servlet from above -->

    <servlet>
        <servlet-name>GwtRpcCommLayerServlet</servlet-name>
        <servlet-class>com.googlecode.gwtrpccommlayer.server.GwtRpcCommLayerServlet</servlet-class>
        <init-param>
            <param-name>GwtRpcCommLayerServletImplClass</param-name>
            <param-value>example.server.GreetingServiceImpl</param-value>
        </init-param>
    </servlet>

    <!-- Default page to serve -->
    <welcome-file-list>
        <welcome-file>Example.html</welcome-file>
    </welcome-file-list>
Reply all
Reply to author
Forward
0 new messages