I create a tag cloud.In this cloud i display some values.
<c:forEach items="${alltags}" var="search">
<a href='${tags.display}'/>
</c:forEach>
Now.i have another jsp,where i perfom the searching.I have an input field and the user can give a value and perform the search when click’s on a button. In this specific occasion i’m trying, when the user will click at the link of a value (on the cloud) to send automatically the value of the tag (tags.display) in the input box and make the search.
The searching JSP
<form:form method="POST" commandName="search">
<tr>
<td><spring:message code="blah"/></td>
<td><form:input path="apath" /></td>
</tr>
</form>
<input type="submit"/>
What do you propose me to do?
Well, first of all, a search form should use GET rather than POST: a search is an idempotent operation, that doesn’t modify anything at server side.
If you switch your method to GET and submit the form, you’ll notice that the URL invoked by the form is something like:
http://www.foo.com/app/search?abstracts=<what the user typed>.Just make your links have the same href, and the link will send the same request as the search form:
Also, note that your submit input should be inside the form, and not outside.