Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<jsp:param> and "="

Status
Not open for further replies.

joelmac

Programmer
Jun 4, 2002
92
CA
Good Day:

I want to have a site with public and private information. Anyone can see the public information, but a username and password is required to view the private information.

I want to have a login form on every page so that the user can login from anywhere in the site and then continue from that page, so I have an include, to include the login form, with parameters so the ProcessLogin.jsp will know where to return to.

Code:
<jsp:include page=&quot;Login.jsp&quot;>
    <jsp:param name=&quot;source&quot; value=&quot;<%= request.getRequestURI() %>&quot;/>
    <jsp:param name=&quot;queryString&quot; value=&quot;<%= request.getQueryString() %>&quot;/>
</jsp:include>

the Login.jsp has two hidden fields to pass the source and queryString to the ProcessLogin.jsp which sould forward to that address.

The problem is the
Code:
<jsp:param />
tag does not seem to like the equals &quot;=&quot;. When I view the HTML source of the page everything looks good exept for the querystring hidden field which looks like:
Code:
<input type=&quot;Hidden&quot; name=&quot;querySting&quot; value=&quot;null&quot;>
. I've tried to append the queryString the the source parameter, but then the whole source parameter comes up
Code:
null
.

Pages without queryStrings work fine. Any ideas?? Does this look like the right way to do this? Is there a better way? ________________________
JoelMac
ICQ#:48144432
 
Hi there

I might be a little confused about whats going on but you could try moving the <%= request.getRequestURI() %> to within the Login.jsp file. I am guessing once you have the user name and password you do some authentication and then redirect back to the page they came from or the requestURI. So something like this:

LOGIN.JSP =

If ((request.getParameter(&quot;user&quot;).equals(&quot;WHATEVER&quot;)) && (request.getParameter(&quot;pass&quot;).equals(&quot;WHATEVER&quot;)) {

String redirect = request.getRequestURI;
response.sendRedirect(redirect);
}

I hope this is of some help.


Justin. X-)
&quot;Creativity is the ability to introduce order into the randomness of nature.&quot; Eric Hoffer

Visit me at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top