Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping a request to a JSP in WEB.XML

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Awesome Andres! Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic