Re: Multiple struts-config.xml files?

2002-02-14 Thread Jin Bal

I asked a similar question re potential problems with multiple action
servlet instances(no reply).  I think the issues may have something to do
with the actionservlet resources but I'm not sure and would be **very**
interested in finding out as I'm using this approach using struts 1.0.

Jin


- Original Message -
From: Struts Newsgroup @[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 14, 2002 8:55 AM
Subject: Re: Multiple struts-config.xml files?


 Subject: Re: Multiple struts-config.xml files?
 From: Jens Mander [EMAIL PROTECTED]
  ===

 Which are the alterations required to allow struts 1.0 to permit multiple
 Action Servlets?
 Doesn't a container (e.g. Tomcat) generate separate instances for each
 action servlet which reads its own struts-config file and if so what kind
of
 threading problems could occur?

 In my case I've been using an approach similar to what Michael
 describes without the RoleDispatcherServlet
 and I am worried about these threading problems you mention.

 Thanks,

 Ronaldo

 Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]...
  Struts 1.0 isn't designed to permit multiple ActionServlets. Unless
  you've made some alterations, there may be threading problems.
 
 --cut

 
  -- Ted Husted, Husted dot Com, Fairport NY USA.
  -- Java Web Development with Struts.
  -- Tel +1 585 737-3463.
  -- Web http://www.husted.com/struts/




 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Multiple struts-config.xml files?

2002-02-14 Thread Ted Husted

The Struts 1.0 ActionServlet stores a number of elements in Application
scope. 

// Publish our internal collections as necessary
getServletContext().setAttribute(Action.FORM_BEANS_KEY,
formBeans);
getServletContext().setAttribute(Action.FORWARDS_KEY, forwards);
getServletContext().setAttribute(Action.MAPPINGS_KEY, mappings);

So, it's really not really threading issues (mispoke), but the last
ActionServlet would win when it came to the Application scope elements.
The custom tag extensions look to these to retrieving the ActionForwards
and what not. 

Check for these statics in utils.RequestUtils, and you will see what I
mean.

Of course, if you are not using the custom tags, then it may not matter. 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Struts Newsgroup (@Basebeans.com) wrote:
 
 Subject: Re: Multiple struts-config.xml files?
 From: Jens Mander [EMAIL PROTECTED]
  ===
 
 Which are the alterations required to allow struts 1.0 to permit multiple
 Action Servlets?
 Doesn't a container (e.g. Tomcat) generate separate instances for each
 action servlet which reads its own struts-config file and if so what kind of
 threading problems could occur?
 
 In my case I've been using an approach similar to what Michael
 describes without the RoleDispatcherServlet
 and I am worried about these threading problems you mention.
 
 Thanks,
 
 Ronaldo
 
 Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]...
  Struts 1.0 isn't designed to permit multiple ActionServlets. Unless
  you've made some alterations, there may be threading problems.
 
 --cut
 
 
  -- Ted Husted, Husted dot Com, Fairport NY USA.
  -- Java Web Development with Struts.
  -- Tel +1 585 737-3463.
  -- Web http://www.husted.com/struts/
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Multiple struts-config.xml files?

2002-02-14 Thread Press, Michael


For the record, to create multiple ActionServlets, I just extended
ActionServlet with an empty class body - basically creating an identical
servlet with a different name, for each role.  This is working fine with
each ActionServlet reading a different struts-config file.  Could there be
some other problem with resources?


-Original Message-
From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 3:55 AM
To: [EMAIL PROTECTED]
Subject: Re: Multiple struts-config.xml files?


Subject: Re: Multiple struts-config.xml files?
From: Jens Mander [EMAIL PROTECTED]
 ===

Which are the alterations required to allow struts 1.0 to permit multiple
Action Servlets?
Doesn't a container (e.g. Tomcat) generate separate instances for each
action servlet which reads its own struts-config file and if so what kind of
threading problems could occur?

In my case I've been using an approach similar to what Michael
describes without the RoleDispatcherServlet
and I am worried about these threading problems you mention.

Thanks,

Ronaldo

Ted Husted [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]...
 Struts 1.0 isn't designed to permit multiple ActionServlets. Unless
 you've made some alterations, there may be threading problems.

--cut


 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Java Web Development with Struts.
 -- Tel +1 585 737-3463.
 -- Web http://www.husted.com/struts/




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Multiple struts-config.xml files?

2002-02-13 Thread Nick Pellow

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 [EMAIL PROTECTED]
To: 'Struts User List' [EMAIL PROTECTED]
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:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Multiple struts-config.xml files?

2002-02-13 Thread Ted Husted

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:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]