You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Graham <dg...@hotmail.com> on 2002/08/07 16:07:48 UTC

needs improvement

My apologies for posting this twice but there was no response the first 
time.  If there's no response this time I'll consider this a dead issue and 
crawl back into my dark corner :-).

I think <html:link> could be improved if it had a <param> subtag like the 
JSTL <c:url> tag does.  Here's my comparison of the 2 ways to create a link 
with multiple query string parameters (either I'm doing this terribly wrong 
or the struts way is just much harder than it should be):


JSTL Method
<c:url var="editUrl" value="/division/editDivision.do">
<c:param name="id" value="${division.divisionID}" />
<c:param name="action" value="edit" />
</c:url>
<a href="<c:out value="${editUrl}" />">Edit</a>

Struts Method
<%
java.util.Map urlParams = new java.util.HashMap();
urlParams.put("action","edit");
urlParams.put("id",((Division)pageContext.getAttribute("division")).getDivisionID());
pageContext.setAttribute("urlParams", urlParams);
%>
<html:link
page="/secure/division/editDivision.do"
name="urlParams"
>
Edit
</html:link>

Which way do you think is easier?  Am I missing something in struts that 
would make this easier?

Thanks,
Dave

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: needs improvement

Posted by "Craig R. McClanahan" <cr...@apache.org>.
It could well be that your improvement is valuable.  The challenge is that
we're well into beta testing for Struts 1.1 and are not adding new
features at the moment (if we kept doing that, we'd never get done).

The best way to capture new ideas for future releases is to post them as
an enhancement request on the bug tracking system
<http://nagoya.apache.org/bugzilla/>.

With regards to this particular suggestion, I think you'll see a push
towards using JSTL directly in future revs of Struts.

Craig


On Wed, 7 Aug 2002, David Graham wrote:

> Date: Wed, 07 Aug 2002 08:07:48 -0600
> From: David Graham <dg...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: <html:link> needs improvement
>
> My apologies for posting this twice but there was no response the first
> time.  If there's no response this time I'll consider this a dead issue and
> crawl back into my dark corner :-).
>
> I think <html:link> could be improved if it had a <param> subtag like the
> JSTL <c:url> tag does.  Here's my comparison of the 2 ways to create a link
> with multiple query string parameters (either I'm doing this terribly wrong
> or the struts way is just much harder than it should be):
>
>
> JSTL Method
> <c:url var="editUrl" value="/division/editDivision.do">
> <c:param name="id" value="${division.divisionID}" />
> <c:param name="action" value="edit" />
> </c:url>
> <a href="<c:out value="${editUrl}" />">Edit</a>
>
> Struts Method
> <%
> java.util.Map urlParams = new java.util.HashMap();
> urlParams.put("action","edit");
> urlParams.put("id",((Division)pageContext.getAttribute("division")).getDivisionID());
> pageContext.setAttribute("urlParams", urlParams);
> %>
> <html:link
> page="/secure/division/editDivision.do"
> name="urlParams"
> >
> Edit
> </html:link>
>
> Which way do you think is easier?  Am I missing something in struts that
> would make this easier?
>
> Thanks,
> Dave
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>