tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Léa Massiot <>
Subject From HTTP to HTTPS request.getHeader("referer")
Date Fri, 31 Oct 2014 12:06:14 GMT
Hello and thank you for reading my post.

I'm trying to make a webapp work with HTTPS.
It was working properly with HTTP.
Below is the problem I have.

Inside a servlet, in its "doPost()" method, 
to check whether the "incoming JSP" is "example1.jsp" or "example2.jsp",
I am using the following piece of code:
s_referer = request.getHeader("referer");
if(s_referer.contains("example1.jsp") == true)
    b_jspReferer1 = true;
if(s_referer.contains("example2.jsp") == true)
    b_jspReferer2 = true;

In "example1.jsp" and "example2.jsp" there is a "<form>" element 
which "action" attribute is set to "do_example":
<form method="post" action="do_example">

Now that I'm using HTTPS, "s_referer" is always equal to "do_example" in the
Before, it used to be either "example1.jsp" in case the "incoming" JSP was
and "example2.jsp" in case the "incoming" JSP was "example2.jsp".

I don't know how to correct my code to be able to discriminate between the
two JSPs.
Can you please help me?

I apologize in advance for the barbaric expression "incoming JSP".
I hope my point is understandable despite unfortunate expression.

Best regards.

View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message