Issue Details (XML | Word | Printable)

Key: STR-2527
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Marc Guillemot
Votes: 0
Watchers: 0
Operations

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

Attributes with <rtexprvalue>false</rtexprvalue> in TLD prevent EL evaluation

Created: 27/Jul/05 09:29 PM   Updated: 04/Jul/07 03:25 AM
Component/s: Tiles 1 Plugin
Affects Version/s: 1.2.7
Fix Version/s: 1.3.5

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: Other

Bugzilla Id: 35895
Resolution Date: 30/May/06 12:54 AM
Labels:


 Description  « Hide
In different tld files, different attributes are configured with
<rtexprvalue>false</rtexprvalue>
which prevents using EL in a JSP 2.0 Servlet Container.

This is the case for instance in
- html: tag "javascript" attribute "dynamicJavascript"
- tiles: tag "insert" attribute "attribute"
- bean: tag "struts" attribute "id"

I can't recognize any logic explaining why some attributes accept runtime
expressions and other don't. I think that all attributes should accept runtime
expression to allow EL use.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig McClanahan added a comment - 09/Aug/05 02:51 PM
(In reply to comment #0)
> In different tld files, different attributes are configured with
> <rtexprvalue>false</rtexprvalue>
> which prevents using EL in a JSP 2.0 Servlet Container.
>
> This is the case for instance in
> - html: tag "javascript" attribute "dynamicJavascript"
> - tiles: tag "insert" attribute "attribute"
> - bean: tag "struts" attribute "id"
>
> I can't recognize any logic explaining why some attributes accept runtime
> expressions and other don't. I think that all attributes should accept runtime
> expression to allow EL use.

I don't recall the particular provenance of these particular decisions, but the
last one in particular reminds me of why we made a similar restriction in JSF
1.0 (you can't use an expression for the "id" property of a component). It
turns out that allowing expressions for this case would allow a class of cross
site scripting attacks that would make the application vulnerable. I can look
up the details if need be, but they were compelling enough for the JSF expert
group to set rtexprvalue to false on this attribute (as well as a couple of
other sensitive ones).

Marc Guillemot added a comment - 09/Aug/05 03:59 PM
In fact I had a problem only with the "attribute" attribute of tiles' insert tag
but I have included example from the other taglibs for completeness.

Niall Pemberton added a comment - 06/Nov/05 12:49 PM
Changing this to an enhancement.

Don Brown added a comment - 31/Mar/06 02:12 PM
Ok, I added EL for the dynamicJavascript attribute [390327], but leaving the
'id' attribute for the reasons Craig mentioned. Bumping this ticket over to
tiles...

Don Brown made changes - 23/Apr/06 04:50 AM
Field Original Value New Value
issue.field.bugzillaimportkey 35895 27818
Joe Germuska added a comment - 21/May/06 02:38 AM
Is this still open? From Don's last comment, it sounds like maybe everything is resolved. In any case, it shouldn't be marked for a fix version (1.3.1) that is past, if it's still open, so moving fix version to 1.3.5. If someone else knows more about this issue, please speak up.

Joe Germuska made changes - 21/May/06 02:38 AM
Bugzilla Id 35895
Fix Version/s 1.3.5 [ 21721 ]
Fix Version/s 1.3.1 [ 21686 ]
Assignee Struts Developer Mailing List [ dev@struts.apache.org ]
Repository Revision Date User Message
ASF #410116 Mon May 29 16:25:22 UTC 2006 niallp STR-2527 - Also allow runtime expression in the staticJavascript attribute and update the EL version of the TLD for the Javascript Tag to keep in line with the standard version
Files Changed
MODIFY /struts/action/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld
MODIFY /struts/action/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld

Niall Pemberton added a comment - 29/May/06 11:38 PM
I've updated the JavascriptTag's "staticJavascript" attribute to allow runtime expressions (so that its consistent with the "dynamicJavascript" attribute) and modified the EL version of TLD for the Javascript tag to keep it in line with the standard one:

   http://svn.apache.org/viewvc?view=rev&revision=410116

As far as "taglib" sub-project goes this issue is resolved as the only attributes where runtime expressions are not allowed are the id attributes (and the indexId attribute on the IterateTag).

So what remains is to sort out tiles and there are quite a few attributes where runtime experessions are not allowed:

insert (attribute, beanScope, flush)
definition (scope)
put (name, direct, type, beanScope)
putList (name)
add (value, direct, type, beanScope)
get (flush)
initComponentDefintion (file, className)
useAttribute (className)
importAttribute (scope)

Since the tiles tags are more complicated than the standard ones it needs someone more familiar with tiles determine which attributes are appropriate to change.

Wendy Smoak added a comment - 30/May/06 12:24 AM
Opened as SB-23 for Standalone Tiles since that's where active development is taking place. When that issue is resolved we can bring the changes over to Struts Tiles.

Wendy Smoak made changes - 30/May/06 12:47 AM
Fix Version/s 1.3 Family [ 21698 ]
Bugzilla Id 35895
Fix Version/s 1.3.5 [ 21721 ]
Wendy Smoak added a comment - 30/May/06 12:54 AM
Resolving for 1.3.5, even though it's not completely fixed. See SB-23 for Standalone Tiles.

Wendy Smoak made changes - 30/May/06 12:54 AM
Fix Version/s 1.3.5 [ 21721 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Fix Version/s 1.3 Family [ 21698 ]
Paul Benedict made changes - 04/Jul/07 03:25 AM
Status Resolved [ 5 ] Closed [ 6 ]
Jeff Turner made changes - 01/Feb/10 01:03 AM
Project Import Mon Feb 01 01:03:21 UTC 2010 [ 1264986201992 ]