Configuration of two servlets

Hello there,

My projects consists of two servlets and one of those is the Vaadin one.
I want to switch between them only by URL ending. In deep:


http://localhost:8080/b09/boo
should call servletA (Vaadin app) and

http://localhost:8080/b09/boo.rdf
should call servletB (Non-Vaadin app)

So the only difference is the ending. There is no way to change any other part of the URL.
I tried to accomplish this by different url-patterns in web.xml, but nothing worked out. My
last config was this one:

	<servlet-mapping>
		<servlet-name>servletB</servlet-name>
		<url-pattern>*.rdf</url-pattern>
	 </servlet-mapping>
		<servlet-mapping>
		<servlet-name>servletA</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
                <servlet-name>servletA</servlet-name>
                <url-pattern>/VAADIN/*</url-pattern>
        </servlet-mapping>

According to
this
I tried
to use ‘/’ to declare the default servlet and anything that ends on ‘.rdf’ should be done by servletB. I tried many other
configurations but nothing works the way I want it. Hope anybody knows what to do.

THX

I’m not sure what your problem is (anything in server logs?). I have this in my web.xml and have deployed a test app called mapping.war to test:

    <servlet-mapping>
        <servlet-name>MainServlet</servlet-name>
        <url-pattern>/</url-pattern>
        <url-pattern>/VAADIN/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>MinorServlet</servlet-name>
        <url-pattern>*.rdf</url-pattern>
    </servlet-mapping>

My servlets just print out some message and the request servlet path. When I try these URLs I see the “main” servlet:

http://localhost:8080/mapping/
http://localhost:8080/mapping/foo
http://localhost:8080/mapping/VAADIN/foo

When I try this URL I see the “minor” servlet load:

http://localhost:8080/mapping/foo.rdf

Cheers,
Bobby