struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <Gin.C...@NielsenMedia.com>
Subject RE: Any interest in a tag for URL parameters?
Date Tue, 01 Jul 2003 16:56:51 GMT
Works very nicely too.
Only thing is that you need to use it with a hardcode anchor or you have to
use html-el as it will only generate the String that is the href.

So you can use it like:

<c:url var="url" scope="page" value="/review.do">
   <c:param name="userAction"><bean:message
key='button.view.logs'/></c:param>
   <c:param name="businessEntityID"
value="${associateProductAccessForm.businessEntity.businessEntityID}"/>
   <c:param name="associateID"
value="${associateProductAccessForm.associate.associateID}"/>
</c:url>

<html-el:link href="${url}" target="_blank"
styleId="navLink">Review</html-el:link>

It *would* be a little cleaner to have it as just one enclosing tag.

-Tim

-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Tuesday, July 01, 2003 12:50 PM
To: Struts Users Mailing List
Subject: RE: Any interest in a tag for URL parameters?


BTW, they have this same feature in the JSTL <url> tag.

-----Original Message-----
From: Christopher Bare [mailto:christopherbare@yahoo.com]
Sent: Tuesday, July 01, 2003 12:46 PM
To: struts-user@jakarta.apache.org
Subject: Any interest in a tag for URL parameters?


I'm thinking of coding up a new tag for the html tag
set called 'parameter' that could be nested inside the
<html:link> tag. Usage of this tag would be like these
examples:

<html:link page="/myaction.do"
  <html:parameter id="param1" name="mybean"
property="myproperty"/>
  <html:parameter id="param2" name="mybean"
property="myotherproperty"/>
  <html:parameter id="param3" value="literal-value"/>
</html:link>

<html:link>
  <html:parameter
id="wombatId"><foo:wombat/></html:parameter>
</html:link>

This would give you the ability to append an arbitrary
number of parameters to a URL while remaining purely
tag based. Also, you can specify the value of the
parameter using an application specific custom tag,
such as my wombat tag above.

Disadvantages are verbosity in the JSP, maintenance of
a new tag, and changes to existing code. It would
involve modifying the link tag to keep a Map of
parameters, and allow the inner tags to add to the
map, then build the URL in doEndTag(). Some
re-arrangement would be required of
RequestUtils.computeParameters(), which is already
fairly complicated. RequestUtils.computeParameters()
would have to accept the Map as a formal parameter or
pull it out of pageContext based on a defined key, if
the method signature can'tbe changed.

Does this seem worthwhile? Is it contraindicated for
some reason? Any thoughts?

Thanks,

-Chris





__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



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

---------------------------------------------------------------------
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