Re: Multiple struts-config.xml
On Sat, 20 Dec 2003, Sudhakar G wrote: Hi, Can any one give me a example how struts supports multiple struts-config.xml file? See the struts-example.war that comes with the distribution. Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James Mitchell Software Developer / Struts Evangelist http://www.struts-atlanta.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple struts-config.xml
Hi Ashutosh, My application is huge one and hence the single struts-config.xml becomes bulky. Sometimes even we are getting exception while in purging the struts-config file. So I want to split it in two. From that persepective after going through your mail I have two doubts regarding this. 1. Is splitting the file in the way you mentioned in your mail is possible in Struts 1.0.2 ? 2. If both the struts file related to same application how do we set the relative path of the second struts file in param-name element ? Regards, Sourav -Original Message- From: Ashutosh Satyam [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 10:37 AM To: Struts Users Mailing List Subject: RE: Multiple struts-config.xml Hi, In order to use multiple struts config file, you need to modify the web descriptor file as mentioned below. Thus, the ActionServlet loads each of the application related config file. servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/config/struts1.xml/param-value /init-param init-param param-nameconfig/secondApp/param-name param-value/WEB-INF/config/struts2.xml/param-value /init-param load-on-startup2/load-on-startup /servlet While invoking the Action classes you need to use proper relative path. For this particular case, say you have an Action mapping - Action1 defined in struts1.xml and Action2 defined in struts2.xml To invoke them the URL should be http://hostname/Action1.do http://hostname/secondApp/Action2.do Regards, Ashutosh Satyam -Original Message- From: Sudhakar G [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: Multiple struts-config.xml Hi, Can any one give me a example how struts supports multiple struts-config.xml file? Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple struts-config.xml
Your problem could be solve by this simple method init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml, /WEB-INF/struts-config-timesheet.xml, /WEB-INF/struts-config-recruitment.xml, /WEB-INF/struts-config-staffing.xml, /WEB-INF/struts-config-training.xml, /WEB-INF/struts-config-employeedetails.xml /param-value /init-param Or else the following method posted by Craig. ?xml version=1.0? !DOCTYPE ... [ !ENTITY part1 SYSTEM form-beans.xml !ENTITY part2 SYSTEM global-forwards.xml !ENTITY part3 SYSTEM action-mappings.xml ] struts-config form-beans part1; /form-beans global-forwards part2; /global-forwards action-mappings part3; /action-mappings /struts-config Mohan -Original Message- From: souravm [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 12:28 PM To: Struts Users Mailing List Subject: RE: Multiple struts-config.xml Hi Ashutosh, My application is huge one and hence the single struts-config.xml becomes bulky. Sometimes even we are getting exception while in purging the struts-config file. So I want to split it in two. From that persepective after going through your mail I have two doubts regarding this. 1. Is splitting the file in the way you mentioned in your mail is possible in Struts 1.0.2 ? 2. If both the struts file related to same application how do we set the relative path of the second struts file in param-name element ? Regards, Sourav -Original Message- From: Ashutosh Satyam [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 10:37 AM To: Struts Users Mailing List Subject: RE: Multiple struts-config.xml Hi, In order to use multiple struts config file, you need to modify the web descriptor file as mentioned below. Thus, the ActionServlet loads each of the application related config file. servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/config/struts1.xml/param-value /init-param init-param param-nameconfig/secondApp/param-name param-value/WEB-INF/config/struts2.xml/param-value /init-param load-on-startup2/load-on-startup /servlet While invoking the Action classes you need to use proper relative path. For this particular case, say you have an Action mapping - Action1 defined in struts1.xml and Action2 defined in struts2.xml To invoke them the URL should be http://hostname/Action1.do http://hostname/secondApp/Action2.do Regards, Ashutosh Satyam -Original Message- From: Sudhakar G [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: Multiple struts-config.xml Hi, Can any one give me a example how struts supports multiple struts-config.xml file? Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - 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] - 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]
Re: Multiple struts-config.xml
Just specify whatever files you want to use as a comma-delimited list in the web-xml. See the Struts Mailreader (struts-example) for a working example. HTH, Ted Sudhakar G wrote: Hi, Can any one give me a example how struts supports multiple struts-config.xml file? Thanks in advance.. cheers Sudhakar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple struts-config.xml
Hi, In order to use multiple struts config file, you need to modify the web descriptor file as mentioned below. Thus, the ActionServlet loads each of the application related config file. servlet servlet-nameaction/servlet-name servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/config/struts1.xml/param-value /init-param init-param param-nameconfig/secondApp/param-name param-value/WEB-INF/config/struts2.xml/param-value /init-param load-on-startup2/load-on-startup /servlet While invoking the Action classes you need to use proper relative path. For this particular case, say you have an Action mapping - Action1 defined in struts1.xml and Action2 defined in struts2.xml To invoke them the URL should be http://hostname/Action1.do http://hostname/secondApp/Action2.do Regards, Ashutosh Satyam -Original Message- From: Sudhakar G [mailto:[EMAIL PROTECTED] Sent: Saturday, December 20, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: Multiple struts-config.xml Hi, Can any one give me a example how struts supports multiple struts-config.xml file? Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - 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]
Re: multiple struts-config.xml - multiple modules?
If the tools are being developed by the same people, you'll probably be better off using mutiple struts configuration files than modules. Modules are best suited for when things are being developed by independant parties who aren't working together. If that doesn't describe you, then just give each tool it's own subdirectory and use that same name to identify everything else that goes with the tool. Even if you used modules, you can't distribute them as separate WARs. If your container supports single logon, as Tomcat does, you can distribute each tool as a separate application and flip back and forth between after a single logon. With a modern container, you can also share JARs and save some resources. The applications can't share session information, though, so you'd have to pass everything through the request or cookies or a database. HTH, Ted. -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Michael Blair wrote: I have a question regarding overall architecture. I am going to have a huge web app; well it will be a suite of web based tools. Lets say I will have one main menu, and from there possibly 5 separate modules (separate content areas). First, how hard is it to have a struts-config for each module (I have an example below). Second, can each module be in its own war and still be able to go back and forth among the other modules? web.xml init-param param-nameconfig/param-name param-value/WEB-INF/config/struts-config.xml/param-value /init-param init-param param-nameconfig/module1param-name param-value/WEB-INF/config/struts-module1-config.xml/param-value /init-param now the actions work fine in the default config, but how do I call an action FROM the default to module 1? Here is what I have tried in my .jsp. Note, this .jsp is part of the default and im trying to call something in module1. html:link page=/action/module1/getmodule1action . . . Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple struts-config.xml for Struts 1.1
I have some code on my website for having multiple config files under Struts 1.0x, however, I never got around to porting the code to 1.1x. You should be able to look at the 1.0x code and somewhat easily port it to 1.1x. -james [EMAIL PROTECTED] http://www.jamesholmes.com/struts/ --- Chen, Dean (Zhun) [EMAIL PROTECTED] wrote: There were description about implementing multiple struts-config.xml in Struts 1.0x, see http://www.mail-archive.com/struts-user@jakarta.apache.org/msg28739.html Are there any similar solutions for Struts 1.1? Thanks Dean Chen -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- 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]
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]
Re: multiple struts-config.xml
See the mail archive: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg13197.html it's in the middle of the message. Original Message Follows From: Mike Dewhirst [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: multiple struts-config.xml Date: Thu, 16 Aug 2001 13:27:45 +0100 is it possible to have struts-config split over several files? and use some xml include directive? =** If you are not the intended recipient, employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination or copying of this communication and its attachments is strictly prohibited. If you have received this communication and its attachments in error, please return the original message and attachments to the sender using the reply facility on e-mail. Internet communications are not secure and therefore the UCLES Group does not accept legal responsibility for the contents of this message. Any views or opinions presented are solely those of the author and do not necessarily represent those of the UCLES Group unless otherwise specifically stated. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses although this does not guarantee that this email is virus free. **= _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp