0

I have a signup.jsp page, there are some input boxes of html on this page, there is a input box for email-id also, when i submit form after fill up there is server side checking of email address, if email address already exist in database then signup.jsp page will redered again, then i want all the value should be dispalyed in all the input boxes that the user filled before submitting the form.

Appropriate help will be appreciable...

Ankur jain
  • 963
  • 3
  • 14
  • 21

3 Answers3

1
<input type="text" name="email" value="<c:out value='${param.email}'/>"/>

This displays the value of the email request parameter in the email text box. Initially, this parameter won't exist, so the text box will be blank.

Note the use of the <c:out> JSTL tag, which allows HTML-escaping the value of the parameter.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • I find `fn:escapeXml()` much cleaner when used in tag attributes. It's also more friendly for (IDE) syntax highlighting and XML based validators. – BalusC Sep 29 '11 at 01:51
0

Your form parameters should be wrapped in a element. When submitted they will be sent to server using request parameters.

Then in your jsp file you need to render those request parameters in the places they should appear. Initially they will be empty, so user will see them rendered as initial blank values to fill.

mateusz.fiolka
  • 3,032
  • 2
  • 23
  • 24
0

The better approach is that you have to create a bean with session scope using <jsp:useBean/>, on server code update the bean's attributes and in view (jsp) page embed bean's property value to the <input/> attributes.

<form method='post' action='your_action'>
  <input type='text' value="<c:out value='${bean.name}'/>" name='name'/>
</form>
KV Prajapati
  • 93,659
  • 19
  • 148
  • 186