File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

servlet mapping

Ionut Barau

Joined: Feb 18, 2008
Posts: 25
Hi.I am new to Servlets and i have a question about servlet mapping.Does <url-pattern> in web.xml have to be the same as the path of the request? Can the path in <url-pattern> point to another location? or it has to be the same as the location of the jsp that requests for the servlet that I am mapping?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63532

Not sure what you are asking. The URL pattern can be whatever makes sense and doesn't conflict with the other patterns.

[Asking smart questions] [About Bear] [Books by Bear]
Venkata Kumar
Ranch Hand

Joined: Apr 16, 2008
Posts: 110

see this link for information about web.xml tags

use of url patterns is explained in servlets specification

SCJP 5.0, SCWCD 5, preparing for SCDJWS
I agree. Here's the link:
subject: servlet mapping
jQuery in Action, 3rd edition