Re: dynamically add action ?
Thanks for all your input, and Manfred's doc. I have checked the list archive, and found the similar discussion (looking for Dynamic configuration). I think my question is similar. let me explain a bit more on what I am doing: 1. I am building a portal type web application, and I want to use Struts as a framework. 2. along the way, people will add web applications, for example, a new leave submit/approval application, which is also web based and struts based. 3. so once we have the leave application developed, we need to integrate into the employee portal. first of all, I need to modify some web pages (jsp files for example) so employees will know that the application is ready. when they click the hyperlink they should start using that. Tiles is being used here because I want to make sure the consistent UI layout when users are using the leave application (for example, the header/footer are the same as the portal pages). the leave application will have some java classes, so that's why i was asking if it is ok to dynamically add them into a running application folder. so my question is, how to support this requirement in Struts ? --- Mark Lowe [EMAIL PROTECTED] wrote: I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
Re: dynamically add action ?
I would approach this (i haven't tried this) as i said before, by having an app that modifies the dynamic apps and lets you reload them. This way you can build it for different containers and if the reload fails you can manage it. I know there were some postings yesterday that sounded very informed and stuff, but i cant see how you dynamically change the same app that modifies itself before reloading with a reasonable level of redundancy. I'd also suggest this is a problem broader than struts but more a question of java/jsp. Struts will just make life easier when developing java/jsp apps. Separating the apps would also make things easier in terms of clearly defining the work to be done. Cheers Mark On 8 Jan 2004, at 11:07, lixin chu wrote: Thanks for all your input, and Manfred's doc. I have checked the list archive, and found the similar discussion (looking for Dynamic configuration). I think my question is similar. let me explain a bit more on what I am doing: 1. I am building a portal type web application, and I want to use Struts as a framework. 2. along the way, people will add web applications, for example, a new leave submit/approval application, which is also web based and struts based. 3. so once we have the leave application developed, we need to integrate into the employee portal. first of all, I need to modify some web pages (jsp files for example) so employees will know that the application is ready. when they click the hyperlink they should start using that. Tiles is being used here because I want to make sure the consistent UI layout when users are using the leave application (for example, the header/footer are the same as the portal pages). the leave application will have some java classes, so that's why i was asking if it is ok to dynamically add them into a running application folder. so my question is, how to support this requirement in Struts ? --- Mark Lowe [EMAIL PROTECTED] wrote: I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff
Re: dynamically add action ?
I am thinking of another solution - saw people talking about action chain but do not really understand: in the page, I use url encoding to differentiate applications: html:link page=/appl.do?applname=app1Application 1/html:link In the struts-config.xml, i define a stub action: ~ action path=/process type=com.StubAction scope=session /action Then in StubAction.java: String procname = request.getParameter(applname); So from here, how can I pass control to an action which is defined based on the applname ? thanks ! __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically add action ?
Based on the code snippet you provided you could just define forwards on the action which match the possable values of procname. -Original Message- From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:03 AM To: [EMAIL PROTECTED] Subject: Re: dynamically add action ? I am thinking of another solution - saw people talking about action chain but do not really understand: in the page, I use url encoding to differentiate applications: html:link page=/appl.do?applname=app1Application 1/html:link In the struts-config.xml, i define a stub action: ~ action path=/process type=com.StubAction scope=session /action Then in StubAction.java: String procname = request.getParameter(applname); So from here, how can I pass control to an action which is defined based on the applname ? thanks ! __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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: dynamically add action ?
If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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: dynamically add action ?
hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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] ds __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamically add action ?
I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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] ds __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamically add action ?
lixin chur You must configure your context as the following: Context path=/template docBase=/J2EELoesungen/Projekte/Template/webapps/template reloadable=true cookies=true Logger className=org.apache.catalina.logger.FileLogger prefix=template_log. suffix=.txt timestamp=true / /Context where path is the webapp context and the docbase the phisical folder, where your webapp is placed. The reloadabe flag indicates, that tomcat will reload if there are changes. But: That have nothing to do with struts and jsp! Also I think, this is the default behavior. At runtime, you can only change your jsp, nothing else if you don't want, that the tomcat has to restart. Manfred lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamically add action ?
Isn't there a way to reinitialize the ActionServlet (or any Subclass that you may be using) at runtime. I think there is something to this effect in the Orielly Struts book. If I remember correctly , the book list two ways of doing it. Can't recollect it right now :(. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 5:29 AM To: Struts Users Mailing List Subject: Re: dynamically add action ? I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus
Re: dynamically add action ?
Maybe.. cant say i recall anything that adventurous in programming with jakarta struts. Just seems logical to me that if you're making changes to code as runtime, and thinking of reloading it then separating the apps makes sense. If something goes wrong, you can manage it. Otherwise if the app bails it bails and its game over. On 7 Jan 2004, at 14:28, Shishir K. Singh wrote: Isn't there a way to reinitialize the ActionServlet (or any Subclass that you may be using) at runtime. I think there is something to this effect in the Orielly Struts book. If I remember correctly , the book list two ways of doing it. Can't recollect it right now :(. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 5:29 AM To: Struts Users Mailing List Subject: Re: dynamically add action ? I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
RE: dynamically add action ?
Aaah..found it. There are no practical example of how to do it, but the author says that to reload configuration files by creating an Action to reinitialize the ActionServlet. Other approach is to create a thread and check the last modified date of the config file. If changed, it's time to reload the config. Not sure how this is done but would appreciate any info if anyone has already done this. I guess the whole reloading concept falls in that 5% bracket identified by to boldly go where no man has gone before ;) -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 8:38 AM To: Struts Users Mailing List Subject: Re: dynamically add action ? Maybe.. cant say i recall anything that adventurous in programming with jakarta struts. Just seems logical to me that if you're making changes to code as runtime, and thinking of reloading it then separating the apps makes sense. If something goes wrong, you can manage it. Otherwise if the app bails it bails and its game over. On 7 Jan 2004, at 14:28, Shishir K. Singh wrote: Isn't there a way to reinitialize the ActionServlet (or any Subclass that you may be using) at runtime. I think there is something to this effect in the Orielly Struts book. If I remember correctly , the book list two ways of doing it. Can't recollect it right now :(. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 5:29 AM To: Struts Users Mailing List Subject: Re: dynamically add action ? I'm not really sure what you're trying to do, but assuming its necessary to generate java code, jsp's etc, i'd be looking at doing this using 2 webapps 1 would serve as basically a code generator the other would be the generated app. A bit like the admin and manager webapps bundled with tomcat. This way your code generator could act as a controller and fire up some ant tasks to compile and then redeploy the generated app. Again not sure what you're attempting, but if it were the case that you didn't need to generate an action servlet but rather have an action where the beans are dynamic I'd be looking into dynabeans to achieve this. I'd be interested in knowing what the actual problem is you're solving. Cheers Mark On 7 Jan 2004, at 11:14, lixin chu wrote: hi, i just tried these sceniors, it seems that nothing happened. I checked Tomcat log file, could not find when it restarted. do i need to check something special ? --- Carl [EMAIL PROTECTED] wrote: If you add new java code in a running Tomcat context, by default the context will restart itsel automaticly. Carl lixin chu wrote: Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus --- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33
Re: dynamically add action ?
Hi. After the discussion today I have made a litte paper how to add actions dynamically. Enjoy. There is a step by step tutorial, what to do. At runtime I change in this little description my actionpath from demo.jsp to demo2.jsp. There are a few modification necessary. After that you can configure and modify any term, that is described in the struts-config. There are a few application that need this, but there are. Manfred http://www.manfred-wolff.de/Configuration.pdf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamically add action ?
So, I re-read the original post and follow-ups, and it doesn't seem like this is what was being asked for at all. Maybe it's me, but it sounded like there was just some confusion about how to do *development*, not how to dynamically add actions at runtime. If that's the case, Li Xin should check out Tomcat's Application Developer's Guide: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html Specifically, it details the use of the install, reload, and remove ant tasks that make modifying and reloading an app fairly painless without having to restart the container. As for the changes outlined in Manfred's document, I'd recommend a search of a struts-user archive (particularly for messages from Craig) as to why ReloadAction was removed from 1.1 and why config freezing is important. Quoting Manfred Wolff [EMAIL PROTECTED]: Hi. After the discussion today I have made a litte paper how to add actions dynamically. Enjoy. There is a step by step tutorial, what to do. At runtime I change in this little description my actionpath from demo.jsp to demo2.jsp. There are a few modification necessary. After that you can configure and modify any term, that is described in the struts-config. There are a few application that need this, but there are. Manfred http://www.manfred-wolff.de/Configuration.pdf -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamically add action ?
li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enthält möglicherweise vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamically add action ?
Thanks ! I am very new to this web application world, just wanted to clarify if I can do these in a running Struts application without restart Tomcat: 1. Can I modify existing JSP files ? Yes, I have tried 2. Can I add new JSP files into existing folder ? I think so. 3. Can I create new folders for some new JSP files ? 4. Can I add new java class into an existing folder ? 5. Can I create a new folder for some new Java classes ? thanks li xin --- Manfred Wolff [EMAIL PROTECTED] wrote: li xin. In my opinion it is no problem to add a jsp-file to a struts application at runtime. For this you don't need to restart the server. Changing the configuration at run time is not possible with the current implementation of struts. After a module is initialized the ActionServlet-class freezes the configuration. Before that you can add configurations such as actions, forwards etc. with the plug-in mechanism, because the init() method of the plugin has full access to the ModuleConfig. You can override the ActionServlet Methode init() and don't freeze the moduleConfig. In this case you have the possibility to add actions and forwards to the configuration at run time. Manfred lixin chu wrote: hi, i would like to know if it is possible to dynamically (without restart servlet engine) add Actions. say for example, i have one struts based application running. now i want to add one hyperlink in a JSPfile which points to another struts based application module. how do i do it ? is there any existing soultion ? thanks li xin __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- === Dipl.-Inf. Manfred Wolff --- phone neusta : +49 421 20696-27 phone : +49 421 534522 mobil : +49 178 49 18 434 eFax : +49 1212 6 626 63 965 33 --- Diese E-Mail enth#37590;t m#39939;licherweise vertrauliche und/oder rechtlich gesch#40695;zte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt#40688;lich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]