Hi,
When you make this change, the flow is:
1. Try getHeader("Referer").
2. If #1 returns null, try getParameter("myReferer").
Since myReferer is not a header, you can't get it as a header ;)
You can URL-encode things in JavaScript by using the escape(string) function. But
that's getting to be off-topic for this list ;)
Yoav Shapira
Millennium ChemInformatics
>-----Original Message-----
>From: Maria Tan [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, July 30, 2002 11:43 AM
>To: Tomcat Users List
>Subject: Re: AW: getHeader("Referer") and document location
>
>Hi, Ralph:
>
>Thanks you. But i just change to code in my javascript
>function:
>
>out.println("document.location=\"CheckURL1myReferer=CheckURL1\";");
>
>In my second servlet(CheckURL1). i still get null
>through getHeader("Referer")
>
>Beside, i am just wondering if it is possible to use
>the resonse.encodeUrl in the JavaScript function.
>
>Your help is appreciated.
>
>Maria
>
>--- Ralph Einfeldt <[EMAIL PROTECTED]>
>wrote:
>> If CheckURL1 is the url to your servlet
>> you should use something like:
>>
>> out.println("document.location=\"");
>>
>out.println(response.encodeUrl("CheckURL1?myReferer=test"));
>> // The call to encodeUrl ensures that the link will
>> contain
>> // the session id if the browser has cookies
>> disabled.
>> // The separator between the servlet and the first
>> parameter
>> // is ?. All further params are separated by &
>> // e.g.: "CheckURL1?myReferer=test&age=18"
>> out.println("\";");
>>
>> > -----Urspr�ngliche Nachricht-----
>> > Von: Maria Tan [mailto:[EMAIL PROTECTED]]
>> > Gesendet: Dienstag, 30. Juli 2002 16:55
>> > An: Tomcat Users List
>> > Betreff: RE: getHeader("Referer") and document
>> location
>> >
>> > Would you mind tell me how to urlEncode the my
>> second servlet
>> > URL in the javascript.
>> <snip/>
>> > out.println("<SCRIPT LANGUAGE=\"JavaScript\">");
>> > out.println("function
>> loadcheckmodificationservlet()");
>> > out.println("{");
>> >
>>
>out.println("document.location=\"CheckURL1&myReferer=test\";");
>> > out.println("}");
>> > out.println("</script>");
>> >
>> <snip/>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com
>
>--
>To unsubscribe, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>