File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes remitting values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "remitting values" Watch "remitting values" New topic

remitting values

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hello Ranchers,

I have designed a dynamic registration page in which i am verifying Login name already exists or not(i am verifying from servlet where all the details entered by the user get stored)and if the Login name is already there in database, servlet takes user back to original registration page alongwith all the details which user has entered on registration page so that user can only change his username and no need to fill up all the details again.

What i am doing is using Request.getParameter on the same registration page to reterive values again after checking in the database for username.


String Login=request.getParameter("member_login");
<input type="password" name="member_password" maxlength="20" value="<%=Login%>
Now it is working fine,

But my problem is I have provided one field as "Salutaion" in the registration form which has two options "Mr" and "Ms" ,
now as "Salutaion" fieled has two options "Mr" and "Ms" i am unable to retrive parameters back on my registration page. eg:

String Salutation=request.getParameter("Salutation");

<td style="background-color: #FFEAC5; border-style: inset; border-width: 0"><font style="font-size: 10pt; color: #000000">Salutation*</font></td><td style="background-color: #FFFFFF; border-width: 1"><select name="Salutation"><option value="--Select--"></option><option value="2" >Mr.</option><option value="1" >Ms.</option></select></td>

Please suggest what should i pass in the above value filed (i.e. value="2" and value="1") so that i will be able to retrive parameters on the registration page for field salutation.

please suggest at your earliest.

Also my another query is, once if the Login name already exist in database servlet will take me back to registration page. Now i would like my cursor in value field for Login name so that user can directly enter new login name.(i mean same as focus and select in javascript, but now i want this on jsp page)

please revert at your earliest. Thanks in advance.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

after comeback on registration page you need apply the if conditions like

Example code:

use same code for <select> is value is not equal to null then set this value inside the selected attribute.

hope it helps..

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63868

If you were using modern standards -- using the EL as opposed to scriptlets -- this would not be an issue.

would be all the code that you needed.
[ March 23, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Thank you Ranchers...will try and update you on the same.

I agree. Here's the link:
subject: remitting values
jQuery in Action, 3rd edition