You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Press, Michael" <Mi...@Artesia.com> on 2002/02/13 22:28:25 UTC
Multiple struts-config.xml files?
I want to have multiple workflows, with users mapped to a particular
workflow based on their role. I know that Struts doesn't support this now.
Is there an intent to support this in the future?
In the meantime, I'm interested in suggestions on the best way to implement
this.
Right now, I've done this:
1) I've created multiple ActionServlets, each of which reads it's own
struts-config file. Each pair is the workflow for one role.
2) I've got a RoleDispatcherServlet that intercepts all Struts URLs,
converts the URL to call the appropriate ActionServlet for the user's role,
and forwards to that URL.
Any additional suggestions or alternative methods are appreciated.
Michael
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Multiple struts-config.xml files?
Posted by Nick Pellow <ni...@cortexebusiness.com.au>.
I just had one ActionServlet, and for each action
defined in it's struts-config.xml, there is a separate
forward defined per role (prefixed by role name).
"role1_success"
"role2_success" etc.
All forward name strings (e.g. "success") get intercepted essentially by a
super
class Action and then the user's role is added to the forward name.
The actual ActionForward is then looked up in the action mapping and
returned to the Struts ActionServlet.
Regards,
Nick
----- Original Message -----
From: "Press, Michael" <Mi...@Artesia.com>
To: "'Struts User List'" <st...@jakarta.apache.org>
Sent: Thursday, February 14, 2002 8:28 AM
Subject: Multiple struts-config.xml files?
> I want to have multiple workflows, with users mapped to a particular
> workflow based on their role. I know that Struts doesn't support this
now.
> Is there an intent to support this in the future?
>
> In the meantime, I'm interested in suggestions on the best way to
implement
> this.
>
> Right now, I've done this:
> 1) I've created multiple ActionServlets, each of which reads it's own
> struts-config file. Each pair is the workflow for one role.
> 2) I've got a RoleDispatcherServlet that intercepts all Struts URLs,
> converts the URL to call the appropriate ActionServlet for the user's
role,
> and forwards to that URL.
>
> Any additional suggestions or alternative methods are appreciated.
>
> Michael
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Multiple struts-config.xml files?
Posted by Ted Husted <hu...@apache.org>.
Struts 1.0 isn't designed to permit multiple ActionServlets. Unless
you've made some alterations, there may be threading problems.
Struts 1.1 does speak to the issues you raise, but we are all still
getting our heads around it, and trying to put some documentation
together.
I was also just thinking about trying something like what Nick
describes, but in the context of localization or "browserization", but
it could work the same as roles. But I'm thinking along the lines of
getting the ActionMapping and ActionForwards do the work.
What I'm thinking about is using an ActionMapping subclass as an
ActionForward factory. When calling findMapping, you could also pass the
request. It would then return a new ActionForward, that would know how
to amend the path according to something in the request or session. Like
the locale, or maybe a role object.
It would then work like Nick described. Instead of just going to
/pages/some.jsp, it could go to /pages/fr/some.jsp or pages/zh/some.jsp.
Or in your case /pages/manager/some.jsp or /pages/clerk/some.jsp. If
some paths could be changed, and others couldn't, there might be a
marker in the path, like /pages/{0}some.jsp, for the ones that could be
merged.
Still at the thinking stage though.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
"Press, Michael" wrote:
>
> I want to have multiple workflows, with users mapped to a particular
> workflow based on their role. I know that Struts doesn't support this now.
> Is there an intent to support this in the future?
>
> In the meantime, I'm interested in suggestions on the best way to implement
> this.
>
> Right now, I've done this:
> 1) I've created multiple ActionServlets, each of which reads it's own
> struts-config file. Each pair is the workflow for one role.
> 2) I've got a RoleDispatcherServlet that intercepts all Struts URLs,
> converts the URL to call the appropriate ActionServlet for the user's role,
> and forwards to that URL.
>
> Any additional suggestions or alternative methods are appreciated.
>
> Michael
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>