wood burning stoves 2.0*
The moose likes Servlets and the fly likes mapping a servlet to multiple urls. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "mapping a servlet to multiple urls." Watch "mapping a servlet to multiple urls." New topic
Author

mapping a servlet to multiple urls.

kamal krishna bhatt
Ranch Hand

Joined: Apr 26, 2011
Posts: 41

how can we map a servlet to the number of urls in web.xml but condition is url name should be fully qualified i.e. like http://x.x.x.x/abc/pqr and can we write all these urls in a separate file and fill them in to web.xml.
Stoian Azarov
Ranch Hand

Joined: Jun 01, 2011
Posts: 113

HTH
kamal krishna bhatt
Ranch Hand

Joined: Apr 26, 2011
Posts: 41

ya that is right but it is not working when i give URL as <url-pattern>http://x.x.x.x/project1/test</url-pattern>
....
works fine only when i give URL as <url-pattern>/test</url-pattern>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Right. You do not include the protocol and domain in the mapping. Just the path relative to the deployed application.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mapping a servlet to multiple urls.
 
Similar Threads
requested resource not found error
Deploying a new application
How can I remove java package (classpath location) information out of my URL? on Tomcat
difference between servlet 2.3 and 2.4
Web Application Folder