java - Href and tag cloud in JSP -


i create tag cloud.in cloud display values.

 <c:foreach items="${alltags}" var="search">    <a href='${tags.display}'/>  </c:foreach> 

now.i have jsp,where perfom searching.i have input field , user can give value , perform search when click's on button. in specific occasion i'm trying, when user click @ link of value (on cloud) send automatically value of tag (tags.display) in input box , make 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 propose me do?

well, first of all, search form should use rather post: search idempotent operation, doesn't modify @ server side.

if switch method , submit form, you'll notice url invoked form like: http://www.foo.com/app/search?abstracts=<what user typed>.

just make links have same href, , link send same request search form:

<a href="<c:url value="/search">              <c:param name="abstracts" value="${tag.display}"/>          </c:url>">${tag.display}</a> 

also, note submit input should inside form, , not outside.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -