Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » more then one servlet
more then one servlet [message #669770] Wed, 11 May 2011 13:09 Go to next message
Ivana Missing name is currently offline Ivana Missing nameFriend
Messages: 14
Registered: December 2010
Junior Member
Is it possible to define more than one servlet in one bundle?

in web.xml :

<servlet>
<servlet-name>servlet1</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet </servlet-class>
</servlet>

<servlet>
<servlet-name>servlet2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet </servlet-class>
</servlet>

in WEB-INF: servlet1-servlet.xml and servlet2-servlet.xml

but what with Web-ContextPath?

Ivana

[Updated on: Wed, 11 May 2011 13:52]

Report message to a moderator

Re: more then one servlet [message #669819 is a reply to message #669770] Wed, 11 May 2011 16:15 Go to previous messageGo to next message
rshelley  is currently offline rshelley Friend
Messages: 59
Registered: April 2010
Member
Like a regular web application, you can have multiple servlets, you just need mappings to each one:

  <servlet-mapping>
    <servlet-name>servletA</servlet-name>
    <url-pattern>/servletA/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>servletB</servlet-name>
    <url-pattern>/servletB/*</url-pattern>
  </servlet-mapping>


Your web context is common to both:

/foobar/servletA/
/foobar/servletB/
Re: more then one servlet [message #670022 is a reply to message #669819] Thu, 12 May 2011 12:38 Go to previous message
Ivana Missing name is currently offline Ivana Missing nameFriend
Messages: 14
Registered: December 2010
Junior Member
I made mistake during entering path in browser (I forgot web context path to enter), everything works fine.

thank you for the answer,

Ivana
Previous Topic:Can't deploy simple WAR
Next Topic:Bundles in Virgo, Bundles in Eclipse RCP
Goto Forum:
  


Current Time: Thu Dec 05 15:54:08 GMT 2024

Powered by FUDForum. Page generated in 0.02692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top