You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Vitor Souza (JIRA)" <ji...@apache.org> on 2006/11/09 02:08:57 UTC
[jira] Created: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Some actions that use Generics make OGNL throw ClassCastException
-----------------------------------------------------------------
Key: WW-1495
URL: http://issues.apache.org/struts/browse/WW-1495
Project: Struts 2
Issue Type: Bug
Components: Actions, Expression Language
Affects Versions: 2.0.1
Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
Reporter: Vitor Souza
When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tom Schneider updated WW-1495:
------------------------------
Fix Version/s: (was: Future)
2.1.0
2.0.7
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: https://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Fix For: 2.0.7, 2.1.0
>
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Vitor Souza (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/WW-1495?page=all ]
Vitor Souza updated WW-1495:
----------------------------
Attachment: OgnlRuntime.java
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: http://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/WW-1495?page=all ]
Ted Husted updated WW-1495:
---------------------------
Flags: [Patch]
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: http://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Fix For: Future
>
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WW-1495) Some actions that use Generics make
OGNL throw ClassCastException
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41013 ]
Don Brown commented on WW-1495:
-------------------------------
If this is actually an OGNL bug, I think we should close it here and move the discussion to the OGNL project.
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: https://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Fix For: 2.0.8
>
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Don Brown resolved WW-1495.
---------------------------
Resolution: Duplicate
Fix Version/s: (was: 2.0.8)
Added OGNL ticket: http://jira.opensymphony.com/browse/OGNL-80
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: https://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Anonymous (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/WW-1495?page=all ]
Attachment: OgnlIssue.zip
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: http://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Attachments: OgnlIssue.zip
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Vitor Souza (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/WW-1495?page=all ]
Vitor Souza updated WW-1495:
----------------------------
Attachment: OgnlIssue.war
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: http://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Attachments: OgnlIssue.war, OgnlIssue.zip
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-1495) Some actions that use Generics make OGNL
throw ClassCastException
Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Husted updated WW-1495:
---------------------------
Flags: (was: [Patch])
Fix Version/s: (was: 2.0.7)
2.0.8
Deflagging this as a patch, since the reporter says that the suggestions should be reviewed by someone who understands OGNL (which would not be me).
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: https://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Fix For: 2.0.8
>
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1495) Some actions that use Generics make
OGNL throw ClassCastException
Posted by "Vitor Souza (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/WW-1495?page=comments#action_38639 ]
Vitor Souza commented on WW-1495:
---------------------------------
I tried adding these comments to the attachment, but for some reason it didn't work. So the purpose of this comment is to present the attachments:
* OgnlIssue.war: packaged Web Application that demonstrates the issue. After deploying, assuming the server is at localhost:8080, open the URL http://localhost:8080/OgnlIssue/manageEmployee/home.action. Select some checkboxes and click Delete to get the ClassCastException.
* OgnlIssue.zip: the source code of the application.
* OgnlRuntime.java: source code of class ognl.OgnlRuntime taken from OGNL 2.6.9. It is hacked to circumvent the ClassCastException. The changes are described here: http://forums.opensymphony.com/thread.jspa?threadID=34624&tstart=0
> Some actions that use Generics make OGNL throw ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1495
> URL: http://issues.apache.org/struts/browse/WW-1495
> Project: Struts 2
> Issue Type: Bug
> Components: Actions, Expression Language
> Affects Versions: 2.0.1
> Environment: Kubuntu Linux 6.06 and 6.10 running Eclipse 3.2 with Web Tools with an Apache Tomcat 5.5 integrated into the IDE.
> Reporter: Vitor Souza
> Attachments: OgnlIssue.war, OgnlIssue.zip, OgnlRuntime.java
>
>
> When the action class extends a class that uses generics (e.g. public class ManageEmployeeAction extends CrudAction<Employee, Long> { }) and data is sent from the web page (using Struts Forms built by the tag library) to be set in a property from the class that is inherited from the superclass and defined as generic (e.g., protected I[] ids;), OGNL cannot determine the type of the property, falls back to String[] and throws a ClassCastException.
> This issue has been further discussed in the forum: http://forums.opensymphony.com/thread.jspa?threadID=48752. Attachments are provided to illustrate the issue and propose a starting point for the fix. However, it should NOT be considered a patch, since the creator of this "hack" doesn't have enough knowledge of OGNL and Generics to assure its general correctness.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira