<label for="recs">Search picture</label><br>
<input type="text" id="recs" name="recs" value="${reco}" style="width: 292px; "/>
This is what I am using for accepting a value into the text box. How do I print the submitted value into the web page?
After submitting the form, you mean? Just get it from the request parameter map ${param}
using the parameter name as key (the input field name becomes the request parameter name).
${param.recs}
Beware of XSS attacks however. Use either JSTL <c:out>
or fn:escapeXml()
to HTML-escape it.
<c:out value="${param.recs}" />
Note that Java/JSP have nothing to do with JavaScript.
you can use the following: <%= reco %> this will print the value
– Bala Sep 26 '12 at 16:45