Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Original Servlet Name after a Forward to a jsp

 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am sure there is an answer to this one but i have not been able to find out.
I have a servlet registered as xxx from which i forward to some jsp page /yyy/zzz.jsp
How can i get the original xxx Servlet name in the zzz.jsp
I have tried the Referer in the header, the request URI, the Servlet name in the request and the Path Info. None of these have worked as all return /yyy/zzz.jsp
Any Help will be greatly appreciated
TIA
S
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you should attach the servlet name to the request with setAttribute before forwarding so the JSP can get it later.
 
Garrett Smith
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it shouldn't matter which servlet they came from the jsps point of view. Jsp shouldn't handle conditional logic, or if it does, it should be limited to just presentation as much as possible.
Having said that, you could use request.getRequestURL() (see the javadoc for HttpServletRequest).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic