• Post Reply Bookmark Topic Watch Topic
  • New Topic

Find out which jsp page called the concerned page  RSS feed

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one JSP page - AA.jsp, whicjh is called be a few other JSP pages. I would like to implement a simple way inside AA.jsp to detect which page called it. In this way the code inside AA.jsp can automatically decide whether it needs to stuff a javaBean.
This problem may be very simple fo ryour guys.
Please help me
Thanks in advance
Ruilin
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you could attach an identifying tag "previousPage" to the HttpSession - assuming your customers allowed cookies.
Bill
 
Li Yi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I normally just pass along a value when calling from different pages to a particuliar jsp page, then get the value from this page, if/switch to do different task accordingly.
 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use request.getHeader("Referer") on the called page to get
the URL of the calling page.
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to All.
I will try what you have suggested.
I will keep you posted.
Best wishes
Ruilin
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alok's method works nicely.
Thanks all.
Ruilin
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!