opensubscriber
   Find in this group all groups
 
Unknown more information…

i : issues@struts.apache.org 11 December 2007 • 9:21AM -0500

[jira] Created: (WW-2366) UIBean and "#attr.theme" conflicts with el scoped variables w/ same name
by Bob Tiernay (JIRA)

REPLY TO AUTHOR
 
REPLY TO GROUP




UIBean and "#attr.theme" conflicts with el scoped variables w/ same name
------------------------------------------------------------------------

                 Key: WW-2366
                 URL: https://issues.apache.org/struts/browse/WW-2366
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.11
            Reporter: Bob Tiernay
            Assignee: Don Brown


In org.apache.struts2.components.UIBean the following lines:

573            // If theme set is not explicitly given,
574            // try to find attribute which states the theme set to use
575            if ((theme == null) || (theme.equals(""))) {
576                theme = (String) stack.findValue("#attr.theme");
577            }

Cause problems if the following jsp snippet exists above a UIBean extended tag in the current page:
<s:set name="theme" value="theme" scope="page" />

This causes a class cast exception if the type of the page scoped variable is not a string.

The proposed fix would be either:
1. Perform an instanceof check to ensure that the value is a string (better)
2. avoid #attr.theme altogether and use another entry in the value stack (best)


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.