Hi, Yoav:
Thank you for your help. Would you mind tell me how to
ualEncode the my second servlet URL in the javascript.
public void service(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
try {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<SCRIPT
LANGUAGE=\"JavaScript\">");
out.println("function
loadcheckmodificationservlet()");
out.println("{");
out.println("document.location=\"CheckURL1&myReferer=test\";");
out.println("}");
out.println("</script>");
out.println("</head>");
out.println("<body bgcolor=\"white\">");
out.println("<body>");
out.println("<h1>" + "test" + "</h1>");
out.println("<font color=\"#3333FF\"><a
href=\"CheckURL1\">Pending Reviews</a></font></li>");
out.println("<p><b><font color=\"#3333FF\"><a
href=\"javascript:loadcheckmodificationservlet();\">Modify
Audit</a></font></b>");
out.println("</body>");
out.println("</html>");
}
Thanks a lot.
Maria
--- "Shapira, Yoav" <[EMAIL PROTECTED]> wrote:
> Hi,
> IE (5.x) is known to have this issue with the
> Referer header. If you
> are relying on the referrer header (which is not a
> good idea in general,
> but sometimes necessary), you will simply have to
> "add it" to your
> JavaScript. In your case, change
> document.location="SecondServlet" to
>
document.location="SecondServlet&myReferer=blahblah".
> SecondServlet
> would then look for that myReferer param if the
> Referer header is not
> found, and try to deal with it. Remember to
> urlEncode the blahblah URL
> ;)
>
> Most designs I've seen that rely on the Referer
> header can instead be
> done with a marker parameter in the request, e.g.
> comingFrom. So you
> would have
>
document.location="SecondServlet&comingFrom=firstServlet".
> Then SecondServlet (and in fact all your servlets,
> or you could refactor
> this behavior into a Filter) would look from
> comingFrom instead of the
> Referer header.
>
> Yoav Shapira
> Millennium ChemInformatics
>
>
> >-----Original Message-----
> >From: Maria Tan [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, July 29, 2002 6:34 PM
> >To: [EMAIL PROTECTED]
> >Subject: getHeader("Referer") and document location
> >
> >Hi, All:
> >
> >I have two servlets.
> >
> >In my first servlet,I use the
> >document.location="SecondServlet" in my Java script
> >for URL Rewriting,
> >
> >In my second servlet, i use getHeader("Referer") to
> >get the referer. It works well in Netscape, but in
> >IE(5.5),it always returns null.
> >
> >String ref = (String)request.getHeader("Referer");
> >(ref returns null in IE, return URL in Netscape).
> >
> >Any suggestion? If IE didn't pass the Referer
> through
> >Java script, is there another way to work around?
> >
> >Thanks
> >
> >Maria
> >
> >
> >__________________________________________________
> >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]>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>