• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to figure if a servlet invoked as include or forward  RSS feed

 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My servlet should behave differently when called indirectly. How it can figure out that? I remember something like getAttribute("javax.servlet.include.request_uri") or it's for JSP include? Can somebody remind me?
 
Ralph Ma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not quite sure what you want to do. do you just want to know which servlet or jsp has been called that may include or forward to the destination page? In order to get the request uri, getRequestURI or getReqeustURL of HttpServletRequest may help you.

And, there is no such a javax.servlet.include.request_uri attribute in any scopes. if you config an error page, the error handler(servlet/jsp) will have a javax.servlet.error.request_uri attribute in its request scope
[ August 25, 2005: Message edited by: Ralph Ma ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there is such an attribute, and has been for a while. This article has the details.
[ August 25, 2005: Message edited by: Ulf Dittmer ]
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, it's helpful. So, the attributes can give me a clue.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!