aspose file tools*
The moose likes Servlets and the fly likes Mapping a request to a JSP in WEB.XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Mapping a request to a JSP in WEB.XML" Watch "Mapping a request to a JSP in WEB.XML" New topic
Author

Mapping a request to a JSP in WEB.XML

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

This is probably something simple I am just missing, but I would like to map a request to a JSP instead of a Servlet (yes, I know jsp's are servlets) in the web.xml file. I believe this will keep me from having to code "dummy" servlets just to forward a request to the correct view. I shouldn't have too many of these since there will be some pre-processing for most of my Views (filling combo boxes, etc) but I will have a few. I think I would be able to map the request to the actual servlet that the app server converts the JSP to. Something like package.jsp_nameofjsp, but I am not sure.
Thanks.


GenRocket - Experts at Building Test Data
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
hmm how about :

You will be declaring a servlet named XYZ and map it to the jsp file located in <documentRoot>/yourJSPFile.jsp.
So, if you access your XYZ servlet it will print whatever you have in your jsp file.
is this what you're after?
hope this helps


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Andres Gonzalez:
hmm how about :

You will be declaring a servlet named XYZ and map it to the jsp file located in <documentRoot>/yourJSPFile.jsp.
So, if you access your XYZ servlet it will print whatever you have in your jsp file.
is this what you're after?
hope this helps

Figured it was something as easy. Thanks, I will give it a shot.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Awesome Andres! Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping a request to a JSP in WEB.XML