tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Lee Deliang" <just_dar...@hotmail.com>
Subject Re: Loading load two different contexts cause overwriting of the first one's private variables?!?
Date Tue, 11 Jul 2000 11:13:17 GMT
I use jsp: forward page ="..." /> to jump from pages to pages. this works 
fine for my first page a login page. i used the following codes and it can 
go to the next page: <%

    if ( request.getParameter("userNRIC") != null ) {
%>
	<%
  	  if ( request.getParameter("userPassword") != null ) {
	%>
		<jsp:forward page ="staffmain.jsp" />
	<%
  	  }
	%>
<%
    }
%>

However when i tried to do the following for another page i get this:

instead of forwarding me to the desired page it forwards me to another page 
i have. I suspect it is because i used this:

<%!
public String getParam(HttpServletRequest request, String Param)
{
	if(request.getParameter(Param) == null)
	{
		return "";
	}
	else
		return request.getParameter(Param);
}
public boolean requestContains(HttpServletRequest request, String Param, 
String testValue)
{
  	String rp[] = request.getParameterValues(Param);

	if(rp == null)
	{
		return false;
	}
	for(int i = 0; i < rp.length; i++)

		if(rp[i].equals(testValue))
			return true;

	return false;
}
public String isChecked(HttpServletRequest request, String Param, String 
testValue)
{
	return (requestContains(request, Param, testValue)) ? "checked" : "";
}

%>

in the page which i was forwarded to BUT not the one i wanted.

Can any1 help me on this one? What is the proper way to forward from one 
page to another? (action ="..." perhaps in the form?)

I tried to use the form action : action="confirmapply.jsp" and it works BUT 
all my setProperty stuff from the other page cannot set values and all my 
data that was inserted into the database was null.

Darren
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message