File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet mapping" Watch "Servlet mapping" New topic
Author

Servlet mapping

Anupam Sinha
Ranch Hand

Joined: Apr 13, 2003
Posts: 1088
Hi all
Please explain as to what all servlets will map to the BlueServlet.
Assuming the web app is colorapp.

Should'nt /colorapp/hello/blue/ map to BlueServlet.
Please provide examples of what all servlets will match the mapping.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Good question Anupam. If anyone has extra resources (besides the SCWCD study kit) that explain this please provide. I'm having heaps of problems with this.


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
Trying using
<servlet-mapping>
<servlet-name>BlueServlet</servlet-name>
<url-pattern>/blue</url-pattern>
<servlet-mapping
...
I think the trailing slash (/) after the word blue is causing a problem, and the tag name should be "url-pattern".
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
the following entry maps the BlueServlet to all request under the
path ..../blue/..
<servlet-mapping>
<servlet-name>BlueServlet</servlet-name>
<url-pattern>/blue/*</url-pattern>
<servlet-mapping>
Olli
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet mapping