He was asking for the referring page, as I understand it, not the client IP
address, which is what RemoteAddr will be. There's a header attached to such
things; I forget the exact syntax, but running through a snoop servlet and
dumping out header names and values will make it quite clear. It also
doesn't involve any parameter manipulation or anything like that.


>From: Ingo Oppelt <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: AW: get the calling URL
>Date: Fri, 4 May 2001 21:45:04 +0200
>
>hi charles,
>
>for your own pages, it's not that difficult to track down the 'calling
>page'.
>you simply have to attach the name of the calling page at the end of your
>link, for example
>
>[page1.jsp]
><a href="page2.jsp?callingpage=page1">
>
>and then read it from the request object like you did before
>
>[page2.jsp]
>request.getParameter("callingpage");
>
>there might be more sophisticated ways doing that but i am positive that
>this works.
>
>
>ohh, charles wait. there is a better way. i have just checked the javadocs.
>try this:
>
>String callingpage = new Sting();
>callingpage = request.getRemoteAddr();
>
>the method should return the IP adress of the client as a string.
>
>good luck,
>
>iNGo.
>
>
>
>-----Urspr�ngliche Nachricht-----
>Von: A mailing list about Java Server Pages specification and reference
>[mailto:[EMAIL PROTECTED]]Im Auftrag von Charles Luo
>Gesendet: Freitag, 4. Mai 2001 17:34
>An: [EMAIL PROTECTED]
>Betreff: get the calling URL
>
>
>hi, all,
>
>I am wondering how I can get the calling URL.
>
>Let's say, I got two pages:  /test1/foo/page1.jsp. In the page1.jsp,I have
>a
>link to /test2/foo/page2.jsp. Now when I run page2, I want to get the value
>of URL for page2.jsp, i.e. /test1/foo/page1.jsp .
>
>I've tried to use hidden field and then to use
>request.getParameter("hiddenfieldname");
>
>Out of luck, I couldn't get the value.
>
>BTW, I am using WEbLogic Commerce Server 3.2
>
>Any suggestions would be appreciated.
>
>cheers
>~~~~~~~~~~~~~~~~~~~~~~~~~~
>Charles Luo
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
>DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to