String registration="10-120";
<input type="text" name="registrationUpdate" value="Reg#" maxlength="50" /><br>
In the above , value="Reg#" which is hard code.
I want to assign variable to the value. i.e. Means value=registration;
update me!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question is not very clear. I’ll assume the variable is declared inside a servlet, because it’s bad practice to use Java in a JSP. To be able to share a variable between a Servlet whic forwards to a JSP, you need to set this variable into a request attribute:
And then in the JSP, you can get the value of the “registration” attribute using the JSP EL:
You should read the Java EE tutorial: http://docs.oracle.com/javaee/5/tutorial/doc/bnadp.html