struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Jain" <Eric.J...@isb-sib.ch>
Subject Re: Building a link from a form
Date Mon, 23 Jun 2003 12:19:59 GMT
> request.setAttribute("paramMap", PropertyUtils.describe(form));

One issue with PropertyUtils.describe is that it also adds a property
'class' to the map; this would probably have to be removed explicitely.


> For an all-JSP solution, I guess you could do:
>
> <%@ page import="org.apache.commons.beanutils.PropertyUtils" %>
> <jsp:useBean id="paramMap" class="java.util.HashMap"/>
> <c_rt:forEach var="entry" items="<%= PropertyUtils.describe(form) %>">
>   <c:set target="paramMap" property="${entry.key}"
> value="${entry.value}"/> </c_rt:forEach>
> <html:link action="/search" name="paramMap">
>   ...
> </html:link>

Now, next level: all-JSP/XML :-)

It just occured to me that if none of the request parameters needs to be
modified then the parameter map could probably be used directly:

  <html:link action="/search" name="param">

--
Eric Jain


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message