• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Original Servlet Name after a Forward to a jsp

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic