Question about using multiple struts-config.xml files
I am trying to get my application working using multiple struts-config.xml files and I am having problems. I have a few questions regarding setting an application to use multiple config files. This is my current setup in my web.xml file i declare my config files like below: init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/search/param-name param-value/WEB-INF/struts-config-search.xml/param-value /init-param My question is this, now because i have my second config file mapped to the name config/search, do my actions in my struts-config-search.xml file need to start with /search/actionName, or will struts automatically load both configuration files, and thus if the names are unique between the 2 config files, it will know what file to call? If the latter is true, then what is the purpose behind naming the configuration config/search/ -scott -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Question about using multiple struts-config.xml files
get the example from http://www.scioworks.com In short, your dont need to specify the module name -D - Original Message - From: Scott Reisdorf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 06, 2003 5:29 PM Subject: Question about using multiple struts-config.xml files I am trying to get my application working using multiple struts-config.xml files and I am having problems. I have a few questions regarding setting an application to use multiple config files. This is my current setup in my web.xml file i declare my config files like below: init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/search/param-name param-value/WEB-INF/struts-config-search.xml/param-value /init-param My question is this, now because i have my second config file mapped to the name config/search, do my actions in my struts-config-search.xml file need to start with /search/actionName, or will struts automatically load both configuration files, and thus if the names are unique between the 2 config files, it will know what file to call? If the latter is true, then what is the purpose behind naming the configuration config/search/ -scott -- 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]
multiple struts-config.xml files in Struts 1.1?
Is there any chance that James Husted's patch for allowing multiple struts-config.xml files will be included into the final Struts 1.1 release? The reason I'm interested in it, is that I would like to be able to make local customizations to a standard webapp. The local customization would be to create new JSPs to replace default JSPs. A way to do this would be if there could be eg. struts-config.xml and an optional struts-local.xml, that would be read if present. struts-local.xml would contain action elements with the same paths as in struts-config.xml, with forward elements pointing to the locally customized JSPs instead of the default JSPs of the webapp. Is this idea flawed? Or is it reasonable? Thanx! - Steinar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
multiple struts-config.xml files
How can you use multiple xml files instead of the unique struts-config.xml? and use some xml include directive? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Multiple struts-config.xml files?
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?
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?
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]
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]
Re: Multiple struts-config.xml files?
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?
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]