Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getHeader("Referer") is null

843836Jun 30 2004 — edited Jun 30 2004
I know this is in the forum a lot , but I can't get this to work. I have two jsp's on seperate servers. I load the first page by calling the first jsp like: http://server1.com/jsp1.jsp. jsp1.jsp then redirects to another server, over ssl, and calls jsp2.jsp. I need to send a String value from jsp1 to jsp2, but I also need to know the referer. Unfortunately it is always null. Can anyone tell me what is wrong with this code? Should this work?

Thanks,
James
jsp1:
<%@ page import="java.util.*,java.io.*,java.text.*,java.net.*" %>
<HTML>
<HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
    <TITLE>jsp1</title>
</head>
<BODY BGCOLOR="white">

<%

	response.sendRedirect("https://server2.com/jsp2.jsp");

%>

</body>
</html>


jsp2:
<%@ page import="java.util.*,java.io.*,java.text.*,java.net.*" %>
<HTML>
<HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
    <TITLE>jsp2</title>
</head>
<BODY BGCOLOR="white">

<%

	String ref = getHeader("Referer");
	out.write(ref);

%>

</body>
</html>	
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2004
Added on Jun 30 2004
6 comments
1,815 views