I started working with code to support parameters in redirects.  Supporting
strings and primitives were pretty simple.  Supporting ActionMessage and
ActionError objects is where it gets interesting.

Currently, the code looks like this:

RedirectingActionForward forward = 
        new RedirectingActionForward(mapping.findForward("showArticle"));
forward.addParameter("articleId",article.getId());
forward.addActionMessage(request, 
                         new ActionMessage("article.submission.success"));
return forward;

When using keys, it will look like:
forward.addActionMessage(request, getResources(request, key), 
        new ActionMessage("article.submission.success"));

...because the forward object would have no way to get to the moduleConfig.  
It could if all RedirectingActionForward objects came from Action:

RedirectingActionForward forward = 
        createRedirectingActionForward(mapping.findForward("showArticle"));

...in which case Action can instantiate the object and pass a reference to itself
or to the servlet or the servlet context to the new instance.

Also, for messages to be passed, they have to be given parameter names.  The
programmer should be able to configure what parameter name to be used, so this
would be an addition to the struts-config (and can be module specific).

I know not all submissions meet the committers approval, and so I wanted to get
your opinion before I go further.  Is this something I can continue to pursue or
something the committers won't accept anyway?  Any opinion/comments/suggestions
on the solution or its approach is welcome.

Thanks,

Hubert Rabago

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to