struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Phillips (JIRA)" <>
Subject [jira] [Resolved] (WW-4299) Components: "id" parameter is deleted
Date Tue, 18 Mar 2014 15:02:03 GMT


Bruce Phillips resolved WW-4299.

       Resolution: Fixed
    Fix Version/s:     (was: 2.3.x)

see commit cb9f0f5645d05b2f1c7c66640716acff61c4425f

Modified UIBean class to not assign null value to id parameter

Ran all tests in struts2-core and they passed

Ran Struts 2 example applications that use form tags and example application that duplicated
the reporter's issue.  Everything worked correctly.

> Components: "id" parameter is deleted
> -------------------------------------
>                 Key: WW-4299
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tags
>    Affects Versions:
>            Reporter: Walid Ghafir
>            Assignee: Bruce Phillips
>             Fix For: 2.3.17
> When using <s:component> tag, *parameter* named "id" is not accessible in component.
 That seems to be due to UIBean.populateComponentHtmlId() method which always overwrites it
with value of *attribute* named "id", even if id attribute has not been specified.
> For example, here is a call to a test JSP component:
> {code}
> <s:component template="TestComponent.jsp">
> 	<s:param name="id" value="'testIdValue'"/>
> 	<s:param name="test" value="'testTestValue'"/>
> </s:component>
> {code}
> If TestComponent.jsp, {{parameters.test}} will have value "testTestValue" and {{}}
will be null although it's expected to be "testIdValue".
> I think that it's due to method {{populateComponentHtmlId(Form form)}} in {{org.apache.struts2.components.UIBean}}
class that always does this, at the end of the method body:
> {code}
> addParameter("id", tryId);
> {code}

This message was sent by Atlassian JIRA

View raw message