The method you should use depends on how the request is forwarded to the JSP
page.  If the browser is redirected to the .jsp page then the page will not
have access to the original request object that the servlet saw.  It will
have no access to any headers identifying the servlet.  In this case the
servlet must pass a parameter at the end of the URL which would tell the
page who forwarded the request.

For example, the servlet might forward to:

http://myserver.com/mypage.jsp?sourceservlet=myservlet

This is easy to do but will require you to modify the servlet slightly.

If the servlet passes the request object directly to the JSP page somehow,
then the page could use the object to see the URL that the browser
originally used to access the servlet using the
HTTPServletRequest.getRequestURI() method.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 7:58 AM
To: JRun-Talk
Subject: get Servlet details in JSP


hi
 I have a application designed in a way such that  the JSP page is
dispatched from the servlet.
I want to make my application check in the JSP page as to where the request
came from ie did the user type the jsp URL directly or did he come from the
servlet.
How do I check this.
is there something called as HTTP Referer etc.
I would not want to make changes in the servlet I dont mind writing a
common JSP page and including it in all the JSP page.

Any help is greatly appreciated.
Thanks
regards
Sanjeevi
PLAY THE GAME

----------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------------------------------------------------

 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission,  dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error,  please contact the sender and delete the material from any
computer.
-- Phoenix Global Solutions (India) Pvt Ltd., www.pgsolutions.com
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to