You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Bob Tiernay (JIRA)" <ji...@apache.org> on 2007/12/11 02:21:34 UTC
[jira] Created: (WW-2366) UIBean and "#attr.theme" conflicts with
el scoped variables w/ same name
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.
[jira] Updated: (WW-2366) UIBean and "#attr.theme" conflicts with
el scoped variables w/ same name
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown updated WW-2366:
--------------------------
Assignee: (was: Don Brown)
> 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
>
> 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.
[jira] Assigned: (WW-2366) UIBean and "#attr.theme" conflicts with
el scoped variables w/ same name
Posted by "Bob Tiernay (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bob Tiernay reassigned WW-2366:
-------------------------------
Assignee: Tom Schneider
> 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: Tom Schneider
>
> 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.
[jira] Resolved: (WW-2366) UIBean and "#attr.theme" conflicts with
el scoped variables w/ same name
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown resolved WW-2366.
---------------------------
Resolution: Fixed
Assignee: Don Brown (was: Tom Schneider)
I went with option 1 to be more consistent and backwards compatible. Please reopen with a patch if you feel differently.
> 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
> Fix For: 2.1.1
>
>
> 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.
[jira] Commented: (WW-2366) UIBean and "#attr.theme" conflicts with
el scoped variables w/ same name
Posted by "Xavi Arias (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46695#action_46695 ]
Xavi Arias commented on WW-2366:
--------------------------------
Hello, I have this problem still in version 2.1.6, could not be possible to solve the conflict in the second way?
I think is strange to mix in the same context user application and framework specific variables. In my opinion a developer shouldn't be aware of the internal implementation of the templating system.
> 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
> Fix For: 2.1.1
>
>
> 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.