[
https://issues.apache.org/struts/browse/WW-2198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42726
]
Tom Schneider commented on WW-2198:
-----------------------------------
No I did not create another issue for this. Notice I wrote 'external' plugin.
Typically new functionality is created via a googlecode project and added to
the plugin registry. Eventually if the googlecode project is popular enough,
then it would be moved into the plugins hosted by the struts project itself.
(That hasn't happened yet, but I haven't lost hope) The idea here is that we
don't want to be stuck maintaining plugins that very few people use. This has
been the pattern for almost all new plugins that I've seen.
> Integration of Struts 2 and DWR
> -------------------------------
>
> Key: WW-2198
> URL: https://issues.apache.org/struts/browse/WW-2198
> Project: Struts 2
> Issue Type: New Feature
> Components: Integration
> Affects Versions: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7,
> 2.0.8, 2.0.9, 2.0.10
> Reporter: Nestor Boscan
> Assignee: Tom Schneider
> Priority: Minor
> Fix For: 2.1.1
>
>
> In WebWorks there is a DWR and Struts 2 Integration using the DWRAction class
> where yo can invoke the Action methods using DWR. I implemented a similar
> class, but not with all the functionality with Struts 2. I've done a project
> with this integration and it works really great.
> public class DWRAction
> {
> private static final Logger log = Logger.getLogger (DWRAction.class);
>
> public static Object execute (ActionDefinition actionDefinition, Map
> params, HttpServletRequest request, HttpServletResponse response,
> ServletContext servletContext) throws Exception {
> ActionMapping mapping;
> Dispatcher dispatcher;
> Map context;
> ActionProxy proxy;
> try
> {
> dispatcher = Dispatcher.getInstance ();
> mapping = new ActionMapping (actionDefinition.getAction(),
> actionDefinition.getNamespace(), actionDefinition.getMethod(), params);
> context = dispatcher.createContextMap (request, response, mapping,
> servletContext);
> proxy = ((ActionProxyFactory) dispatcher.getContainer
> ().getInstance (ActionProxyFactory.class)).createActionProxy
> (actionDefinition.getNamespace (), actionDefinition.getAction (), context,
> false, false);
> proxy.setMethod (actionDefinition.getMethod ());
> proxy.execute ();
> return (proxy.getAction ());
> }
> catch (Exception e)
> {
> log.error ("Cannot invoke action '" + actionDefinition.getAction() + "'
> in namespace '" + actionDefinition.getNamespace() + "'", e);
> throw e;
> }
> }
> }
> In this case I'm invoking the actions method and returning the action to the
> JSP page so I can access attributes that were set in the invocation. It would
> be nice to have something like this part of the Struts 2 standard. If you
> need help implemening this solution I would gladly help.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.