I have a problem when using jsp:forward. I am writing a page where first
time users are forwarded to an html page where they are prompted to enter in
some personal info. When users log in, the db is queried to determine
whether this information has been collected yet. If not, the page is
displayed. If so, the user is forwarded to the rest of the site.
The problem is that after the user puts the data in the db, the form
continues to come up with subsequent logins, but only if the user accesses
the page from browser's history or from a link sent in an email. If the user
clears their cache, deletes their history, and opens a new browser, the code
works as intended and the data entry page is not displayed. System.out
statements show that the db is being checked and my if/then statement is in
fact being followed. Can anybody help solve this mystery? Code below.
Thanks in advance,
matt
<%
String user = request.getRemoteUser();
String data = Subject.checkForUserData(user);
if (data==null || data.equals("")==true){
%>
<jsp:forward page= "new_user.html" />
<%
}else if ((data!=null) && data.equals("")==false){
%>
<jsp:forward page= "restofsite.html" />
<%
}
%>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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