I've been using the "action" attribute to specify a Struts action to generate the item's URL. It works great, including adding the current Struts module to the generated link.
However, I wish to include a menu item that links to a Struts action in another module. That is, the menu is rendered in the context of "moduleA", but one of the menu items is for an action in "moduleB".
My first thought was to use the "location" attribute and include the module in the url, but I would like the symmetry of specifying "action" everywhere. Also, I have a custom permissions checker that looks up Struts actions, and needs to know the module for that purpose.
I ultimately settled on patching MenuBase to add a "module" attribute such that when it is specified in combination with page or action the URL is computed with the page or action looked up from that module, instead of the current module.
Was this the correct approach? Is there another way of doing it cleanly? Is it a worthwhile modification? I can supply a patch if anyone is interested.
Cheers,
Tim
View this message in context: Linking to actions in other Struts modules
Sent from the struts-menu-user forum at Nabble.com.
[struts-menu] Linking to actions in other Struts modules
Tim Morrow 2 (sent by Nabble.com) Mon, 06 Feb 2006 18:14:02 -0800
- [struts-menu] Linking to actions in othe... Tim Morrow 2 (sent by Nabble.com)
- Re: [struts-menu] Linking to action... Matt Raible
- Re: [struts-menu] Linking to ac... Tim Morrow 2 (sent by Nabble.com)
- Re: [struts-menu] Linking t... Matt Raible
- Re: [struts-menu] Linki... Tim Morrow 2 (sent by Nabble.com)
