[VELTOOLS] StrutsLinkTag.setForward
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, This might be more of a user list question, but I'll ask anyway. Does anyone know if it's possible to use StrutsLinkTool.setForward() to get a forward that is local to the currently-executing action mapping? I want to use the same action and same resulting template under two different URL spaces (basically the same flow with two separate entry and exit points). If each URL space could have (nearly) identical action mappings, I wouldn't have to change anything but the link and form targets in my existing templates. StrutsLinkTool is documented to get the given global forward name converted into a server-relative URI reference. Is there another tool or technique that would get me what I want? Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGQKHK9CaO5/Lv0PARAhfQAKCxDWzERPzmHT9/K9Vl+tPhSXm5HACeOxVa +8KZZniJH0hzehaAPJUX2Pg= =YWti -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VELTOOLS] StrutsLinkTag.setForward
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nathan, Nathan Bubna wrote: I'm not sure. Have you tried it? Of course! ;) It doesn't work :( StrutsLinkTool.setForward() basically just hands things off to StrutsUtils.getForwardURL(request, app, forward), which says it Returns the action forward name converted into a server-relative URI reference and doesn't mention the word global. StrutsLinkTool.setForward does say global while StrutsUtils.getForwardURL does not. However, a quick look at the code shows that there's no attempt to deal with the currently-running ActionConfig: ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app); ForwardConfig fc = moduleConfig.findForwardConfig(forward); // massage the String a bit and return I'm not sure how it would affect any other code, but it would be nice to add/change-it-to something like this: ActionConfig actionConfig = request.getAttribute(Globals.MAPPING_KEY); ForwardConfig fc = actionConfig.findForward(forward); // massage and return ActionConfig.findForward returns either a local forward or a global forward if no matching local is found (or null is nothing is found at all). I would imagine that the ActionConfig would already know about its enclosing ModuleConfig so I think it can be a straight replacement. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGQKdZ9CaO5/Lv0PARAsxFAJ9XeSNrBMa0tfRfx0iOcwtYuiZ8VwCeOInh MVmh/8Hloz1oWVoiu/5zQKc= =H3lX -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VELTOOLS] StrutsLinkTag.setForward
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, Okay, so I needed to change my code just a hair to make it work, but it does work. I'm going to file a JIRA issue and attach a patch. We can discuss any implications of applying said patch in JIRA. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGQKnd9CaO5/Lv0PARAtgmAKCYdaMns6PRaGJeiBErxIsAsqVLOACePIbE xMxmb1eRq8MgTDgE7U0silE= =mnvd -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VELTOOLS] StrutsLinkTag.setForward
On 5/8/07, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nathan, Nathan Bubna wrote: I'm not sure. Have you tried it? Of course! ;) just didn't want to assume... :) It doesn't work :( StrutsLinkTool.setForward() basically just hands things off to StrutsUtils.getForwardURL(request, app, forward), which says it Returns the action forward name converted into a server-relative URI reference and doesn't mention the word global. StrutsLinkTool.setForward does say global while StrutsUtils.getForwardURL does not. However, a quick look at the code shows that there's no attempt to deal with the currently-running ActionConfig: ModuleConfig moduleConfig = ModuleUtils.getInstance().getModuleConfig(request, app); ForwardConfig fc = moduleConfig.findForwardConfig(forward); // massage the String a bit and return I'm not sure how it would affect any other code, but it would be nice to add/change-it-to something like this: ActionConfig actionConfig = request.getAttribute(Globals.MAPPING_KEY); ForwardConfig fc = actionConfig.findForward(forward); // massage and return ActionConfig.findForward returns either a local forward or a global forward if no matching local is found (or null is nothing is found at all). I would imagine that the ActionConfig would already know about its enclosing ModuleConfig so I think it can be a straight replacement. sounds sensible. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGQKdZ9CaO5/Lv0PARAsxFAJ9XeSNrBMa0tfRfx0iOcwtYuiZ8VwCeOInh MVmh/8Hloz1oWVoiu/5zQKc= =H3lX -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]