Issue Details (XML | Word | Printable)

Key: STR-746
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul Benedict
Reporter: Jesse Blomberg
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts 1

Add <html:param> for multiple parameters

Created: 25/Jul/02 07:45 AM   Updated: 04/Jul/07 03:36 AM
Component/s: Tag Libraries
Affects Version/s: Nightly Build
Fix Version/s: 1.3.6

Environment:
Operating System: All
Platform: All
Issue Links:
Dependency
 

Bugzilla Id: 11154


 Description  « Hide
Eric Fesler has an extension to the html:link tag. It allows nested param tags
that allow the user to specify multiple parameters appended to the URI without
resorting to a map. Hopefully this could be incorporated into the next release
of Struts.

Thanks,
Jesse Blomberg

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig McClanahan added a comment - 09/Aug/02 07:58 AM
Extensions to the link tag will be addressed in a version of Struts after 1.1.

Ted Husted added a comment - 20/Jan/03 04:03 AM
Marking all current RESOLUTION LATER issues to be against the Nightly Build.

Ted Husted added a comment - 06/Jul/03 06:41 PM
Is there a patch available for Eric Fesler's extension?

Ted Husted added a comment - 08/Sep/03 07:01 AM
Reopening to link with #19256

Ted Husted added a comment - 08/Sep/03 07:02 AM
Reopening to link with #19256 (sic)

David Graham added a comment - 19/Dec/03 09:03 AM
*** STR-761 has been marked as a duplicate of this bug. ***

David Graham added a comment - 19/Dec/03 09:05 AM
*** STR-1588 has been marked as a duplicate of this bug. ***

Paul Benedict added a comment - 02/Sep/06 06:55 AM
Now that the html tags can recognize symbolic action names (STR-2864), any tags which can render a link are much better suited for Struts development than the JSTL <c:url> tag. The only thing missing is the equivalent way to add parameters in a nested tag.

I've enhanced the <html:link> and <html:rewrite> tags to accept a new <html:param> tag which adds any *additional* parameters to the parent's parameters. So the old way works, the new way, and both together.

<html:link action="editPersonAction" name="moreParamsMap">
  <fmt:message key="person.title" />
  <html:param name="param1" value="value1" />
  <html:param name="param2">value2</html:param>
</html:link>







Paul Benedict added a comment - 05/Sep/06 01:20 AM
URL: http://svn.apache.org/viewvc?view=rev&rev=440206
Log: STR-746: New html:param tag; nestable in frame,link,rewrite tags.

Niall Pemberton added a comment - 21/Sep/06 02:52 AM
We've got into trouble in the past with tag pooling when attribute values are reset in the lifecycle methods of the tag. According to the servlet specification its up to the container when the attribute setters and reset methods are invoked - and the pooling strategy used is up to the implementation.

In the case of the ParamTag the "value" property is being (re)set in the doAfterBody() method when the value is specified in the body and I believe this breaks the specification, since its the responsibility of the container and not the tag to set attribute values.

Introducing a new instance variable which is initialized to the "value" property in the doStartTag and reset in the doAfterBody method if the tag has a body would I believe ensure that this doesn't cause problems.

IMO it would also be a good idea to add a new page to the struts-examples webapp - always useful to be able to test tag functionality and to be able to point users asking how to use this new feature.

Paul Benedict added a comment - 21/Sep/06 04:21 AM
Thanks Niall. I figured out the problem after writing to the dev list. It turns out, as you said, it's totally up to the container when the tag is released from the pool. Although the JSP spec says it should happen after the page is finished, this is untrue, and other resources on the web confirm this.

What tripped me up was that there is a difference between properties and attributes. I had a variable not resetting because it wasn't exposed as an attribute. The container resets attributes (defined in TLD), but not internal properties which are your responsibility. That was my intention, but I didn't understand how I overlooked things. Now I do and things are fine. I'll check in the change soon.

Paul Benedict added a comment - 25/Sep/06 05:49 AM
URL: http://svn.apache.org/viewvc?view=rev&rev=449579
Log:
STR-746: Correctly clear internal property; minor consistency changes in subclassed tags.

Paul Benedict added a comment - 25/Sep/06 06:07 AM
Author: pbenedict
Date: Sun Sep 24 23:10:36 2006
New Revision: 449581

URL: http://svn.apache.org/viewvc?view=rev&rev=449581
Log:
STR-746: demonstrate nested param tags

Paul Benedict added a comment - 06/Dec/06 05:24 AM
Missing EL and Nested support

Paul Benedict added a comment - 06/Dec/06 05:46 AM
URL: http://svn.apache.org/viewvc?view=rev&rev=482910
Log:
STR-746: EL+Nested versions of ParamTag and example

Modified:
    struts/struts1/trunk/apps/el-example/src/main/webapp/html-link.jsp
    struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld
    struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld

Modified: struts/struts1/trunk/apps/el-example/src/main/webapp/html-link.jsp

Paul Benedict added a comment - 06/Dec/06 05:46 AM
URL: http://svn.apache.org/viewvc?view=rev&rev=482911
Log:
STR-746: EL+Nested versions of ParamTag and example

Added:
    struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELParamTag.java (with props)
    struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELParamTagBeanInfo.java (with props)

Paul Benedict added a comment - 06/Dec/06 05:50 AM
URL: http://svn.apache.org/viewvc?view=rev&rev=482912
Log:
STR-746: Add SVN properties

Modified:
    struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ParamTag.java (contents, props changed)