how to get the query values from the url in a servlet and pass them to jsp

ok..this is the situation...

all applications are routed through a login page...

so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..the servlet must process the query string and then should pass all those values(as hidden values) to the login jsp..then user enters username and pswd, then there should be another servlet which takes all the hidden values of jsp and also username and pswd, authenticates the user and sends the control back to that particular application along with the hidden values...

so i need help on how to parse the query string from the original url in the servlet, pass it out to jsp, and then pass it back to the servlet and back to the original application...damnn...any help would be greatly appreciated...thanks

[886 byte] By [hari786a] at [2007-11-27 11:44:38]
# 1

Ok. Does this need to be a custom build?

The standard form-authentication that is a standard part of J2EE does this sort of approach. You have to

- define security constraints in your web.xml

- create a "login" page within the constraints

<form method=POST action=j_security_check>

<input type=text name=j_username>

<input type=password name=j_password>

</form>

See the Servlet 2.4 specification section 12.5.3 for details.

-

If you want to do it the hard way: You can get a hold of all the parameters via a call to request.getParameterMap(). You then just need to iterate over that map and duplicate the name/value into hidden fields.

evnafetsa at 2007-7-29 17:56:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...