I have created a servlet that passes a string variable strname to a JSP page.
The JSP recieves it into a variable “strname” using
request.getAttribute("strname")
Now I want to display this inside the text field of a form
<form action="LogoutServlet" method="post">
<% String strname =(String)request.getAttribute("uname");%>
Username:<input type="text" name="username" value="${username}"/>
</form>
but it is displaying “username” int the text field.
How can I display the strname var in the text ??
Please Help
Using
$you can get the value. For ex :<input type="text" name="strname" value="${strname}" />(Assuming you are getting correct value in strname variable.)