[
https://issues.apache.org/struts/browse/WW-1636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Don Brown resolved WW-1636.
---------------------------
Resolution: Fixed
Fix Version/s: 2.0.3
Assignee: Don Brown
You are absolutely right, thanks for the patch!
> PortletActionContext.getDefaultActionForMode - ClassCastException
> -----------------------------------------------------------------
>
> Key: WW-1636
> URL: https://issues.apache.org/struts/browse/WW-1636
> Project: Struts 2
> Issue Type: Bug
> Components: Portlet Integration
> Affects Versions: 2.0.2
> Environment: windowsxp, tomcat, jetspeed 2.0, java 6
> Reporter: Dariusz Wojtas
> Assigned To: Don Brown
> Fix For: 2.0.3
>
> Attachments: WW-1636.patch
>
>
> Simple action in the portlet environment, and a call
> System.out.println("PORTLET: defaultActionForMode: " +
> PortletActionContext.getDefaultActionForMode());
> causes stacktrace:
> 2007-01-11 10:40:22 org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher
> serviceAction
> SEVERE: Could not execute action
> java.lang.ClassCastException:
> org.apache.struts2.dispatcher.mapper.ActionMapping cannot be cast to
> java.lang.String
> at
> org.apache.struts2.portlet.context.PortletActionContext.getDefaultActionForMode(PortletActionContext.java:184)
> at
> pl.impaq.web.struts.view.person.PersonManagementAction.edit(PersonManagementAction.java:56)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:408)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:262)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:224)
> Most likely the action mapping is not a simple String but an
> org.apache.struts2.dispatcher.mapper.ActionMapping instance.
> The method should return the mapping object instead of a String.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira