This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Q on url mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Q on url mappings" Watch "Q on url mappings" New topic
Author

Q on url mappings

Prema Chakravarthy
Ranch Hand

Joined: Jul 13, 2004
Posts: 91
I have a url mapping defined in my web.xml for my servlet servlet1.
/mypath/servlet1/*.html
/mypath/servlet1/*.jsp
/mypath/servlet1/*.do

I also use a context path of "myap".

So, the url used from the browser looks like:
http://www.mycompany.com/myapp/mypath/servlet1/index.html

I am trying to get this mapping to work such that the user can just type in
http://www.mycompany.com/myapp/mypath/servlet1 and it would work.

So, I added the following to the above defined url mappings in web.xml:
/mypath/servlet1

Now www.mycompany.com/myapp/mypath/servlet1 works from the browser but
www.mycompany.com/myapp/mypath/servlet1/index.html doesn't any more.

What gives?

Thanks much!
Prema
Avisesh Jain
Greenhorn

Joined: Mar 16, 2005
Posts: 12
At what place is precisely your index.html(directory structure) and could u please give the entire mapping you have done in web.xml.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Q on url mappings
 
Similar Threads
SendRedirect() - 2 Forms of Relative URL's
Servlet path mapping and relative URLs
404 prob.
Servlet Mapping vs Static resource
response.sendRedirect Problem