[ http://issues.apache.org/struts/browse/WW-1286?page=all ]
Rainer Hermanns reassigned WW-1286:
-----------------------------------
Assign To: Rainer Hermanns
> ClassCastException in LocalizedTextUtils in Portlet when doing a submit to a
> model driven action
> ------------------------------------------------------------------------------------------------
>
> Key: WW-1286
> URL: http://issues.apache.org/struts/browse/WW-1286
> Project: Struts Action 2
> Type: Bug
> Components: Portlet Integration
> Versions: WW 2.2.2
> Reporter: Nils-Helge Garli
> Assignee: Rainer Hermanns
> Fix For: 2.0
>
> Problem with ww:text when a ModelDriven action is invoked in the event phase
> of a portlet request cycle, and the result is a jsp, causing the
> DirectRenderFromEventAction to execute. Root cause is that the
> Jsr168Dispatcher pushes the action executed in the event phase on the top of
> the stack when executing in the render phase (to preserve form parameters and
> possible error/validation messages).
> This causes a NPE in the following code in LocalizedTextUtils:
> [code]
> if (ModelDriven.class.isAssignableFrom(aClass)) {
> ActionContext context = ActionContext.getContext();
> // search up model's class hierarchy
> ActionInvocation actionInvocation = context.getActionInvocation();
> // ActionInvocation may be null if we're being run from a
> Sitemesh filter, so we won't get model texts if this is null
> if (actionInvocation != null) {
> Object action = actionInvocation.getAction();
> Object model = ((ModelDriven) action).getModel();
> if (model != null) {
> msg = findMessage(model.getClass(), aTextName,
> indexedTextName, locale, args, null, valueStack);
> if (msg != null) {
> return msg;
> }
> }
> }
> }
> [/code]
> ww:text evaluates the action on the top of the stack, which is the model
> driven action previously pushed onto the stack, but
> actionInvocation.getAction() returns the DirectRenderFromEventAction which is
> not a model driven action.
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]