How to call to another action from the action class
Hi Guys, I want to call to another action mapping which has defined in the struts.xml file within another action class, its like this, *struts.xml* action name=readThis class=com.test.TestAction method=testMethod result name=success/pages/ext/summary.jsp/result /action currently im inside of another Action class, from that action class i need to call to the above mentioned action mapping... is there anyway to do this.? -- Regards Kushan Jayathilake
Re: How to call to another action from the action class
Hi, Use a type=redirectAction and then set the result to the action name (without .action) Chris Hi Guys, I want to call to another action mapping which has defined in the struts.xml file within another action class, its like this, *struts.xml* action name=readThis class=com.test.TestAction method=testMethod result name=success/pages/ext/summary.jsp/result /action currently im inside of another Action class, from that action class i need to call to the above mentioned action mapping... is there anyway to do this.? -- Regards Kushan Jayathilake - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to call to another action from the action class
You can try by giving the path of the action in place of /pages/ext/summary.jsp. Atleast that was how it is done in struts1.3 Thanks, Jyothi On Thu, Jun 24, 2010 at 11:39 AM, Kushan Jayathilake kusha...@gmail.comwrote: Hi Guys, I want to call to another action mapping which has defined in the struts.xml file within another action class, its like this, *struts.xml* action name=readThis class=com.test.TestAction method=testMethod result name=success/pages/ext/summary.jsp/result /action currently im inside of another Action class, from that action class i need to call to the above mentioned action mapping... is there anyway to do this.? -- Regards Kushan Jayathilake
Re: Struts2 with JDK1.4.2_19 Tomcat 5.0.28
Hi All, Finally i solved this Issue. You have to include jar file named xalan-2.6.0.jar into WEB-INF which is used by Filter class. http://mirrors.ibiblio.org/pub/mirrors/maven2/xalan/xalan/2.6.0/xalan-2.6.0.jar Hope it will solve this Filter start error. My Software versions are Randy Burgess-6 wrote: I am developing on JDK 1.5 and using Maven and the retrotranslator- maven-plugin (1.0-alpha-2, none of the other versions would work for me) to retrotranslate not only struts2-*.jar and xwork*.jar but also all of my source code since that is written and compiled for 1.5. I've run this project on Tomcat 6 (JDK 1.6), WebSphere 6.0 (JDK 1.4) and 6.1 (JDK 1.5) and Jetty 6.1(JDK 1.5). Tomcat and Jetty was just to see if it would run on platforms besides WAS, production will be on WebSphere. After spending 8 weeks developing this app for WAS 6.1 I was asked if I could make it run on 6.0. I'm glad the answer was yes until we can get the licensing issues straightened out. Randy Burgess On Dec 23, 2008, at 2:15 PM, rorostar wrote: Hi, Has anyone had any success trying to use struts2 on java4 environment? My server is using java 1.4.2, and they would not upgrade. `I've read the tutorial on how to use retrotranslator and I've converted the following jars: commons-logging-j4-1.0.4.jar freemarker-j4-2.3.8.jar ognl-j4-2.6.11.jar I was able to get struts2-core-j4.2.0.14.jar and xwork-j4-2.0.7.jar from struts Alternative Java 4 JARs. When I tried to start tomcat server, I got the infamous SEVERE: ERROR filterStart. Dec 23, 2008 12:12:09 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Dec 23, 2008 12:12:09 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 820 ms Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.28 Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardContext start SEVERE: Context startup failed due to previous errors Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Dec 23, 2008 12:12:10 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Dec 23, 2008 12:12:10 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Dec 23, 2008 12:12:10 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=1/37 config=null Dec 23, 2008 12:12:10 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 952 ms I've configured successfully Struts 2 with JRE 1.6 Tomcat 6.0 before, and I'm using exactly the same structure (except for web.xml, I'm using web-app version 2.4 with JDK 1.4.2, as opposed to 2.5 for JRE 1.6). Could anyone help me? -- View this message in context: http://www.nabble.com/Struts2-with-JDK1.4.2_19---Tomcat-5.0.28-tp21149790p21149790.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://old.nabble.com/Struts2-with-JDK1.4.2_19---Tomcat-5.0.28-tp21149790p28981010.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 with JDK1.4.2_19 Tomcat 5.0.28
Dear Raghu, Please install tomcat 6.0 and Java 1.5/1.6 Version to avoid filter start errors. Regards, VR Venugopal Rao -Original Message- From: Raghumys4 [mailto:raghum...@gmail.com] Sent: 24 June 2010 15:51 To: user@struts.apache.org Subject: Re: Struts2 with JDK1.4.2_19 Tomcat 5.0.28 Hi All, Finally i solved this Issue. You have to include jar file named xalan-2.6.0.jar into WEB-INF which is used by Filter class. http://mirrors.ibiblio.org/pub/mirrors/maven2/xalan/xalan/2.6.0/xalan-2.6.0. jar Hope it will solve this Filter start error. My Software versions are Randy Burgess-6 wrote: I am developing on JDK 1.5 and using Maven and the retrotranslator- maven-plugin (1.0-alpha-2, none of the other versions would work for me) to retrotranslate not only struts2-*.jar and xwork*.jar but also all of my source code since that is written and compiled for 1.5. I've run this project on Tomcat 6 (JDK 1.6), WebSphere 6.0 (JDK 1.4) and 6.1 (JDK 1.5) and Jetty 6.1(JDK 1.5). Tomcat and Jetty was just to see if it would run on platforms besides WAS, production will be on WebSphere. After spending 8 weeks developing this app for WAS 6.1 I was asked if I could make it run on 6.0. I'm glad the answer was yes until we can get the licensing issues straightened out. Randy Burgess On Dec 23, 2008, at 2:15 PM, rorostar wrote: Hi, Has anyone had any success trying to use struts2 on java4 environment? My server is using java 1.4.2, and they would not upgrade. `I've read the tutorial on how to use retrotranslator and I've converted the following jars: commons-logging-j4-1.0.4.jar freemarker-j4-2.3.8.jar ognl-j4-2.6.11.jar I was able to get struts2-core-j4.2.0.14.jar and xwork-j4-2.0.7.jar from struts Alternative Java 4 JARs. When I tried to start tomcat server, I got the infamous SEVERE: ERROR filterStart. Dec 23, 2008 12:12:09 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Dec 23, 2008 12:12:09 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 820 ms Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.28 Dec 23, 2008 12:12:09 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardContext start SEVERE: Context startup failed due to previous errors Dec 23, 2008 12:12:10 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Dec 23, 2008 12:12:10 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Dec 23, 2008 12:12:10 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Dec 23, 2008 12:12:10 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=1/37 config=null Dec 23, 2008 12:12:10 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 952 ms I've configured successfully Struts 2 with JRE 1.6 Tomcat 6.0 before, and I'm using exactly the same structure (except for web.xml, I'm using web-app version 2.4 with JDK 1.4.2, as opposed to 2.5 for JRE 1.6). Could anyone help me? -- View this message in context: http://www.nabble.com/Struts2-with-JDK1.4.2_19---Tomcat-5.0.28-tp21149790p21 149790.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://old.nabble.com/Struts2-with-JDK1.4.2_19---Tomcat-5.0.28-tp21149790p28 981010.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org __ DISCLAIMER The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail
RE: How to call to another action from the action class
each action is embedded in its own execution chain e.g. pre-action1 interceptor,action1,post-action1-interceptor pre-action2 interceptor,action2,post-action2-interceptor perhaps what you want is an *post-action1* interceptor http://struts.apache.org/2.x/docs/building-your-own-interceptor.html ? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Thu, 24 Jun 2010 14:37:23 +0530 Subject: Re: How to call to another action from the action class From: jyoraj...@gmail.com To: user@struts.apache.org You can try by giving the path of the action in place of /pages/ext/summary.jsp. Atleast that was how it is done in struts1.3 Thanks, Jyothi On Thu, Jun 24, 2010 at 11:39 AM, Kushan Jayathilake kusha...@gmail.comwrote: Hi Guys, I want to call to another action mapping which has defined in the struts.xml file within another action class, its like this, *struts.xml* action name=readThis class=com.test.TestAction method=testMethod result name=success/pages/ext/summary.jsp/result /action currently im inside of another Action class, from that action class i need to call to the above mentioned action mapping... is there anyway to do this.? -- Regards Kushan Jayathilake _ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccountocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
different validate's() for different actions in java class
Hi Struts 2 users, I have in a class different actions, each one with its own method. I want a validate() method for each of these actions, I'm not sure if I can have more than one validate() method in a class, so all the actions would have the same validation. should i split all my actions in different classes so each one could have its own validate() method?? thanks
Re: IMPORTANT Call action on application deploy, like servlet with load-on-startup (Struts 2)
I've consider that, but the problem is that i want to define dinamically the path of action, but to do that i need HttpServletRequest object and inside init() i don't have access to that object. I want to use httpServletRequest to extract server name and context name. 2010/6/23 Gustavo Felisberto gustavo.felisbe...@wit-software.com: Create a servlet that makes a request to the action. Gustavo Felisberto On 23 de Jun de 2010, at 19:03, Oscar oscar.kalde...@gmail.com wrote: Hi to all, i have the next situation: I need to call an action on application startup like you can call a servlet on application startup by setting load-on-startup parameter servlet on web.xml . I can't use a servlet because i need to trigger my interceptors that initialize JPA EntityManager . Is there a way to achieve this? Best regards. -- Oscar Calderón SCJP 6 http://www.javahowto.net/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Oscar Calderón SCJP 6 http://www.javahowto.net/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: different validate's() for different actions in java class
Depending on which method you call in your class you can just append that method name to the validate() method name. For example: public void validateEdit() { // Validate Stuff here } public void validateUpdate() { // Validate Stuff here } public void validate() { // Validate Stuff here } // Will run validate() public String execute() { return SUCCESS: } // Will run validateEdit() public String edit() { return SUCCESS; } // Will run validateUpdate() public String update() { return SUCCESS: } On Thu, Jun 24, 2010 at 9:53 AM, lucas owen sr.ilus...@gmail.com wrote: Hi Struts 2 users, I have in a class different actions, each one with its own method. I want a validate() method for each of these actions, I'm not sure if I can have more than one validate() method in a class, so all the actions would have the same validation. should i split all my actions in different classes so each one could have its own validate() method?? thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Passing parameters to getter methods?
Hi, I want to call s:iterator and fetch a list by passing it an index. This list will be dynamically generated. s:iterator value=products[#index] var=product status=stat where I want getProducts(Integer index) to be called. Is this possible? Thanks Chris
Re: Page composition strategy
On Wed, 2010-06-23 at 10:36 +0100, Alex Rodriguez Lopez wrote: I've been using Tiles and always found it confusing a little bit, now that I'm starting to test Sitemesh my vote would be for this last one. They accomplish the same thing, only Tiles is like saying each time my page is made up of this, this and this. Sitemesh is more about taking a piece of a page and decorate it into a full page (more like intercepting or filtering). I'd say that Tiles is like saying only _once_ that my base page is made of this and this... and each subsequent page you should say extends the base page, in my case this means that a different jsp is embedded into the body which means a definition only has one line. Each definition can of course override any of the content in base, for instance my base has a left menu, header, body and footer all defined, a tiles definition typically overrides the body portion, but say I made a secureLayout definition then every page that a user needs to log in to see will simply extend the secureLayout definition. I have a layout for displaying records... recordLayout which redefines the header and footer to provide information such as where the data was derived and how many records and navigation between the pages of the table. JSP's that then display records over ride the body section of recordLayout which simply overrides a different header and footer of the Secure Layout. I don't think you can get much more simple than Tiles. I'm not sure if it is the right approach if you had a really modular layout (say you needed to let users add widgets to any page). But if the layout is really hierarchical I'd say it's the way to go.
Re: Page composition strategy
Out of curiosity, has anyone on the list actually used both Tiles and Sitemesh? I'd really like to read a comparison of the two, not just Sitemesh is quite easy to use. vs. I don't think you can get much more simple than Tiles. All I really get from Googling is Sitemesh fanboys bashing Tiles as inferior, but they don't really go into any detail. :( -Brian On Thu, Jun 24, 2010 at 4:11 PM, Ken ken.mcwilli...@aerose.com wrote: On Wed, 2010-06-23 at 10:36 +0100, Alex Rodriguez Lopez wrote: I've been using Tiles and always found it confusing a little bit, now that I'm starting to test Sitemesh my vote would be for this last one. They accomplish the same thing, only Tiles is like saying each time my page is made up of this, this and this. Sitemesh is more about taking a piece of a page and decorate it into a full page (more like intercepting or filtering). I'd say that Tiles is like saying only _once_ that my base page is made of this and this... and each subsequent page you should say extends the base page, in my case this means that a different jsp is embedded into the body which means a definition only has one line. Each definition can of course override any of the content in base, for instance my base has a left menu, header, body and footer all defined, a tiles definition typically overrides the body portion, but say I made a secureLayout definition then every page that a user needs to log in to see will simply extend the secureLayout definition. I have a layout for displaying records... recordLayout which redefines the header and footer to provide information such as where the data was derived and how many records and navigation between the pages of the table. JSP's that then display records over ride the body section of recordLayout which simply overrides a different header and footer of the Secure Layout. I don't think you can get much more simple than Tiles. I'm not sure if it is the right approach if you had a really modular layout (say you needed to let users add widgets to any page). But if the layout is really hierarchical I'd say it's the way to go. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Page composition strategy
On 6/24/10 5:33 PM, Brian Thompson wrote: Out of curiosity, has anyone on the list actually used both Tiles and Sitemesh? I'd really like to read a comparison of the two I used tiles with Struts1 about 6 years ago. I've been using sitemesh with Struts2 for the last several years. I think that sitemesh is more configurable and less constraining. I recall fighting tiles quite a bit. There's a chance this has changed, and if so someone please correct me, but the basic architecture of the two are upside down from one another. With sitemesh your view layer executes (bottom up), then the output of that is collected on the server and pushed through the decorator, which means you can have the decoration change based on the content being decorated, but the cost is that if you generate REALLY LARGE amounts of output for a single page, that translates into REALLY LARGE temporary memory requirements in your server. With tiles it constructs and outputs the page in order, so it can get handed directly to the response and does not need to be stored on the server, but in order to do that the output is generated in the order the tiles define (top down), making it hard to do anything special in outer tiles based on what's determined/displayed by the actual page content. -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: different validate's() for different actions in java class
I think having separate classes would be better. If the validations are almost the same, i.e. one for Add and one for Update of the same object, then perhaps you can have just one action extend another and they can share some common validation code in a method defined in the base action. On 06/24/2010 07:53 AM, lucas owen wrote: Hi Struts 2 users, I have in a class different actions, each one with its own method. I want a validate() method for each of these actions, I'm not sure if I can have more than one validate() method in a class, so all the actions would have the same validation. should i split all my actions in different classes so each one could have its own validate() method?? thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org