You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Al Breight <Br...@avaya.com> on 2005/05/06 00:05:18 UTC
dynamic forwarding
I am working on struts interface that will support a core set of functionality
upon which products can add functionality. Several products may be installed on
one system, all sharing the core functionality. The products that adopt the
core functionality cannot change it, they can only add to it and the core
functionality has no knowledge of any of the products that use it. The core set
of functionality has several pages which are followed by pages specific to a
product. The problem is this: when on a system with several products
installed, the user will access the several core pages, indicating which
product they are using (and these pages/action classes have no built in
knowledge of the products). Then the pages for the product selected need to be
presented. So what I need to do is figure a way of going from "core" page X
to "product" page Y with out "hardcoding" the forwarding in the struts config
file. The action class following core page X will have the name identifying the
product. What would be great is if mapping.findForward() supported a way to
pass in the path that should be forwarded to. The path could be something
like "product name.do".
Has anyone dealt with a similiar issue?
Thanks
Al
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: dynamic forwarding
Posted by Michael Jouravlev <jm...@gmail.com>.
If you know where to forward, you can create a custom ActionForward in
runtime. ActionMapping.findForward() that everyone usually use, is
just a convenience method. You can create your own instance of
ActionForward class with whatever path and request method you like.
Don't change ActionForward instances which correspond to static
struts-config.xml settings, it won't work.
If you problem is detecting where to forward, then it depends. You may
try to use referer as imho the least-intrusive way. Or you can pass
return address to core pages directly.
Michael.
On 5/5/05, Al Breight <Br...@avaya.com> wrote:
> I am working on struts interface that will support a core set of functionality
> upon which products can add functionality. Several products may be installed on
> one system, all sharing the core functionality. The products that adopt the
> core functionality cannot change it, they can only add to it and the core
> functionality has no knowledge of any of the products that use it. The core set
> of functionality has several pages which are followed by pages specific to a
> product. The problem is this: when on a system with several products
> installed, the user will access the several core pages, indicating which
> product they are using (and these pages/action classes have no built in
> knowledge of the products). Then the pages for the product selected need to be
> presented. So what I need to do is figure a way of going from "core" page X
> to "product" page Y with out "hardcoding" the forwarding in the struts config
> file. The action class following core page X will have the name identifying the
> product. What would be great is if mapping.findForward() supported a way to
> pass in the path that should be forwarded to. The path could be something
> like "product name.do".
>
> Has anyone dealt with a similiar issue?
>
> Thanks
> Al
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org