Struts2 s:a tag does not produce the name attribute
Hi There, For AAT reasons I would like to set identities on my links in my JSP files. table s:iterator value=workSheet.entries var=currentEntry status=serverPointer tr td s:a action=EditWorkSheetEntry name=editLink%{#serverPointer.count} Edit s:param name=selectedEntryId value=entryId / s:param name=workSheet_Id value=workSheet.ws_Id / /s:a /td /tr /table But no matter what I do I never get the “name” attribute for my link. The result of the above turns into: table tr td aid=editLink1 href=/DBEXEL/EditWorkSheetEntry.action?selectedEntryId=1amp;workSheet_Id=1Edit/a /td /tr /table Problem: I expect: a name=editLink1. But I get: a Id=editLink1.. Baubak Gandomi 68 rue des Prairies 75020 Paris - France Home: +33-1-46366790 Mobile: +33-60-9596805 Visit the wonderful : http://www.uglycityguide.com
RE: JUnit in Struts
Hello Uday, Why don't you check : http://struts.apache.org/2.x/docs/testing-actions.html It is a bit short, but it worked just fine for me. Best regards, Baubak -Original Message- From: Mano Pájaro [mailto:mano0...@gmail.com] Sent: vendredi 15 juillet 2011 07:39 To: Struts Users Mailing List Subject: Re: JUnit in Struts Hello, any tool for struts 2.2.1? 2011/7/12 Udhay systemudh...@gmail.com Hi, Please help me how to perform JUnit testing in Struts 1.1 applications. Kindly share me any links and other information that will help me a lot. Thanks in advance. GoodWill, Udhay -- Manolo Pájaro Santander Ingeniero de Sistemas VIII Semestre (Actual) Promoviendo el Software Libre CUSOL-UAC Linux Registered User # 522026 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: JUnit in Struts
Sorry this reply was for Mano not Uday... -Original Message- From: Baubak Gandomi [mailto:b.gand...@castsoftware.com] Sent: lundi 18 juillet 2011 17:27 To: Struts Users Mailing List Subject: RE: JUnit in Struts Hello Uday, Why don't you check : http://struts.apache.org/2.x/docs/testing-actions.html It is a bit short, but it worked just fine for me. Best regards, Baubak -Original Message- From: Mano Pájaro [mailto:mano0...@gmail.com] Sent: vendredi 15 juillet 2011 07:39 To: Struts Users Mailing List Subject: Re: JUnit in Struts Hello, any tool for struts 2.2.1? 2011/7/12 Udhay systemudh...@gmail.com Hi, Please help me how to perform JUnit testing in Struts 1.1 applications. Kindly share me any links and other information that will help me a lot. Thanks in advance. GoodWill, Udhay -- Manolo Pájaro Santander Ingeniero de Sistemas VIII Semestre (Actual) Promoviendo el Software Libre CUSOL-UAC Linux Registered User # 522026 - 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
RE: Conditional fire on validation()
Hello Eric, Another way of doing this would be using aliases. In other words the validation.xml file follows the action name not the class. If you send save action foo-save and method save action name=foo-* class=FooAction method={1} result name=successpages/foo.jsp/result You create one declarative validation file per call So you add a validation file per possible action foo-save.xml foo-delete.xml etc why not check : http://struts.apache.org/2.x/docs/validation.html#Validation-HowValidato rsofanActionareFound http://struts.apache.org/2.x/docs/validation.html#Validation-DefiningVal idationRules -Original Message- From: Eric Lentz [mailto:eric.le...@sherwin.com] Sent: lundi 18 juillet 2011 14:16 To: Struts Users Mailing List Subject: Re: Conditional fire on validation() I'm not sure it's exactly what you're looking for, but IIRC there should be a convention for the validate method, such that you can call, for example, a method validateSave, expecting that it's fired contextually with the save action Maurizio Cucchiara Oh yeah! I remember coming across that now. Post 40 with all these frameworks I have stuffed in my head... thanks for the reminder. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Asynchronous Display of Action Results
Hello, I am not able to find any mention of this topic, or even if it is really Struts 2-related. I have a view which calls two actions using s:action. The methods that are called in the domain of the actions take different times to execute. I would like my actions to be run parallel. I.e. Once they are finished executing, that their results are show the moment they finish. ---Struts.xml package name=ActionTests_Application extends=struts-default action name=start result/WEB-INF/pages/main.jsp/result /action action name=action1 class=action_tld.Main_Class method=method1 result name=success/WEB-INF/pages/page1.jsp/result /action action name=action2 class=action_tld.Main_Class method=method2 result name=success/WEB-INF/pages/page2.jsp/result /action /package ---action_tld.Main_Class public class Main_Class { private int delay = 0; public String method1() { setDelay(5000); sleeper(); return ActionSupport.SUCCESS; } public String method2() { setDelay(500); sleeper(); return ActionSupport.SUCCESS; } ---main.jsp body waiting.. table tr td s:action name=action1 executeResult=true/s:action /td tds:action name=action2 executeResult=true/s:action /td /tr /table ---Page1 2 Just show a simple text In the example above method2 takes longer to execute than method1. Today when I execute start The result of action1 is displayed before action2. However what I want is that action1 action2 to be executed simultaneously, and that the result of action2 is presented first. This may not be a Struts2 question perse, but if anyone has any leads I am much obliged. Best regards, Baubak
RE: Asynchronous Display of Action Results
Thanks I'll test your solution, and see how it works. -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: lundi 11 juillet 2011 16:52 To: Struts Users Mailing List Subject: Re: Asynchronous Display of Action Results You can achieve the outcome you desire by using AJAX instead of the s:action tag. Here is an (untested) jquery example - div id=remoteAction1/div div id=remoteAction2/div script type=text/javascript $(document).ready(function() { $(remoteAction1).load(s:url action=action1 /); $(remoteAction2).load(s:url action=action2 /); }); /script I'm too lazy at the moment to make sure that the javascript is correct, so if someone notices any glaring errors, please chime in. -Wes On Mon, Jul 11, 2011 at 10:43 AM, Baubak Gandomi b.gand...@castsoftware.com wrote: Hello, I am not able to find any mention of this topic, or even if it is really Struts 2-related. I have a view which calls two actions using s:action. The methods that are called in the domain of the actions take different times to execute. I would like my actions to be run parallel. I.e. Once they are finished executing, that their results are show the moment they finish. ---Struts.xml package name=ActionTests_Application extends=struts-default action name=start result/WEB-INF/pages/main.jsp/result /action action name=action1 class=action_tld.Main_Class method=method1 result name=success/WEB-INF/pages/page1.jsp/result /action action name=action2 class=action_tld.Main_Class method=method2 result name=success/WEB-INF/pages/page2.jsp/result /action /package ---action_tld.Main_Class public class Main_Class { private int delay = 0; public String method1() { setDelay(5000); sleeper(); return ActionSupport.SUCCESS; } public String method2() { setDelay(500); sleeper(); return ActionSupport.SUCCESS; } ---main.jsp body waiting.. table tr td s:action name=action1 executeResult=true/s:action /td tds:action name=action2 executeResult=true/s:action /td /tr /table ---Page1 2 Just show a simple text In the example above method2 takes longer to execute than method1. Today when I execute start The result of action1 is displayed before action2. However what I want is that action1 action2 to be executed simultaneously, and that the result of action2 is presented first. This may not be a Struts2 question perse, but if anyone has any leads I am much obliged. Best regards, Baubak -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - 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
RE: Asynchronous Display of Action Results
Thanks Wes, script type=text/javascript $(document).ready(function() { $(#remoteAction1).load('s:url action=action1 /'); $(#remoteAction2).load('s:url action=action2 /'); }); /script After figuring out how to work with jquery it all worked like a charm. Thanks for your help. Best regards Baubak -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: lundi 11 juillet 2011 16:52 To: Struts Users Mailing List Subject: Re: Asynchronous Display of Action Results You can achieve the outcome you desire by using AJAX instead of the s:action tag. Here is an (untested) jquery example - div id=remoteAction1/div div id=remoteAction2/div script type=text/javascript $(document).ready(function() { $(remoteAction1).load(s:url action=action1 /); $(remoteAction2).load(s:url action=action2 /); }); /script I'm too lazy at the moment to make sure that the javascript is correct, so if someone notices any glaring errors, please chime in. -Wes On Mon, Jul 11, 2011 at 10:43 AM, Baubak Gandomi b.gand...@castsoftware.com wrote: Hello, I am not able to find any mention of this topic, or even if it is really Struts 2-related. I have a view which calls two actions using s:action. The methods that are called in the domain of the actions take different times to execute. I would like my actions to be run parallel. I.e. Once they are finished executing, that their results are show the moment they finish. ---Struts.xml package name=ActionTests_Application extends=struts-default action name=start result/WEB-INF/pages/main.jsp/result /action action name=action1 class=action_tld.Main_Class method=method1 result name=success/WEB-INF/pages/page1.jsp/result /action action name=action2 class=action_tld.Main_Class method=method2 result name=success/WEB-INF/pages/page2.jsp/result /action /package ---action_tld.Main_Class public class Main_Class { private int delay = 0; public String method1() { setDelay(5000); sleeper(); return ActionSupport.SUCCESS; } public String method2() { setDelay(500); sleeper(); return ActionSupport.SUCCESS; } ---main.jsp body waiting.. table tr td s:action name=action1 executeResult=true/s:action /td tds:action name=action2 executeResult=true/s:action /td /tr /table ---Page1 2 Just show a simple text In the example above method2 takes longer to execute than method1. Today when I execute start The result of action1 is displayed before action2. However what I want is that action1 action2 to be executed simultaneously, and that the result of action2 is presented first. This may not be a Struts2 question perse, but if anyone has any leads I am much obliged. Best regards, Baubak -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - 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
RE: struts tags: How to use a list inside another list
Hi There For your code to work : You should a class in your context that : - Has a field called contentList. The filed contentList should be of a type that Has the fields o expression o translations. This field should then be of a type that has a field called: § translation I hope this helps. Good Luck From: Alexandru [mailto:icid...@yahoo.com] Sent: mardi 14 juin 2011 12:16 To: Struts Users Mailing List; mcucchi...@apache.org Subject: Re: struts tags: How to use a list inside another list thank you, it does work. But i have a problem with arranging the items in the form. This is my form s:form action=do-translate-document cssClass=formtable method=POST s:iterator value=contentList p s:property value=expression / /p s:textarea / s:iterator value=translations ps:property value=translation //p /s:iterator /s:iterator s:submit / /s:form As seen from form i'm trying to achieve this structure: expression texarea_for_new_translation_input submited_translation0 submited_translation1 etc but what i get is different. (check the attachment) --- On Mon, 6/13/11, Maurizio Cucchiara mcucchi...@apache.org wrote: From: Maurizio Cucchiara mcucchi...@apache.org Subject: Re: struts tags: How to use a list inside another list To: Struts Users Mailing List user@struts.apache.org Date: Monday, June 13, 2011, 6:33 PM Try this, AFAICR it should be work s: itarator list=x s: itarator list=y /s:iterator /s:iterator On 14 June 2011 00:21, Alexandru icid...@yahoo.com wrote: I want to do somethink like this s: itarator list=x s: itarator list=x.y /s:iterator /s:iterator is it possible? Or should i use two separate lists? -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Need suggestion to get started Struts 2
Hello Prashid, 1. I would say that you should understand how taglibs work/are called, but it goes with the territory. 2. Why don't you check wildcards for this: http://struts.apache.org/2.x/docs/wildcard-mappings.html It is often used for CRUD implementations. 3. I think that the best place is http://struts.apache.org/2.x/, But I think Viral Patel's tutorial at dzone is quite good as well http://java.dzone.com/articles/struts2-tutorial-part-27 . 4. This I will let for someone else to answer. Good Luck Baubak -Original Message- From: prashid [mailto:pirzada.ras...@gmail.com] Sent: mercredi 18 mai 2011 02:57 To: user@struts.apache.org Subject: Need suggestion to get started Struts 2 Hi, I am new to Java but learning it fast. I have been working in ASP.NET C# for a long time now. Just want to learn Java EE. Just started Strut2 reading online material. Took lots of time to configure Netbeans 7 to work with Struts2 for HelloWorld example but finally did it. I have few things that I want to ask. 1 - Is it right to learn Struts2 without learning JSP first? 2 - Is there any CRUD for Struts2?. I don't find much online to see how Struts2 application is organise and coded. 3 - Big question, Where should I start and what is needed to learn Struts2 (Addons etc) ? 4 - Does Struts2 support templating for Web forms? Hope someone will help me with these Questions. Thanks -- View this message in context: http://struts.1045723.n5.nabble.com/Need-suggestion-to-get-started-Strut s-2-tp4405261p4405261.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
action attribute in reset button
Hi All, I'm currently fiddling with s:reset and have discovered that just like the taglib s:submit it also contains the attributes method and action. Testing it, they do not seem to have any effect: Here is my Action : action name=startResetTest class=org.cast.tests.struts2.misc.tld_tests.ResetClass method=fillList result name=startReset/WEB-INF/pages/TLD_Tests/5.5.Reset.jsp/result /action action name=TLDTests.5.5.2.Reset class=org.cast.tests.struts2.misc.tld_tests.ResetClass result/WEB-INF/pages/endZone.jsp/result /action In my class I have: public class ResetClass { private String modelSignal; public String fillList() { setModelSignal(Passed through fillList); return startReset; } public String resetCase2() { setModelSignal(Passed through Submit Test #2); return ActionSupport.SUCCESS; } public void setModelSignal(String usedModel) { this.modelSignal = usedModel; } public String getModelSignal() { return modelSignal; } } In my view I have : s:property value=modelSignal/ h2Reset Case 2/h2 We specify the action and method through the reset button : s:form s:textfield label=test 2 : name=resetTest2Field/ s:reset action=TLDTests.5.5.2.Reset method=resetCase2/ /s:form My assumption is that if I press rest here I should be send to the action TLDTests.5.5.2.Reset and the method resetCase2 in the class org.cast.tests.struts2.misc.tld_tests.ResetClass. But when I press reset, it just empties the field values of my form and nothing else. I keep the context I even tested this in debug mode. When I press Reset I do not enter the action class. Does anyone know when the action attribute of s:reset is used? Best regards, Baubak
where does s:reset action=X go?
Hi All, I'm currently fiddling with s:reset and have discovered that just like the taglib s:submit it also contains the attributes method and action. Testing it, they do not seem to have any effect: Here is my Action : action name=startResetTest class=org.cast.tests.struts2.misc.tld_tests.ResetClass method=fillList result name=startReset/WEB-INF/pages/TLD_Tests/5.5.Reset.jsp/result /action action name=TLDTests.5.5.2.Reset class=org.cast.tests.struts2.misc.tld_tests.ResetClass result/WEB-INF/pages/endZone.jsp/result /action In my view I have : h2Reset Case 2/h2 We specify the action and method through the reset button : s:form s:textfield label=test 2 : name=resetTest2Field/ s:reset action=TLDTests.5.5.2.Reset method=resetCase2/ /s:form My assumption would be that if I press rest here I should be send to the action TLDTests.5.5.2.Reset and the method resetCase2 in the class org.cast.tests.struts2.misc.tld_tests.ResetClass. But when I press reset, it just empties the field values of my form and nothing else. I keep the context I even tested this in debug mode. When I press Reset I do not enter the action class. Does anyone know when the action attribute of s:reset is used/invoked? Best regards, Baubak Gandomi - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: where does s:reset action=X go?
Thanks for the answer. I'll take a look at s:button then. But the reason I ask is that the documentation : http://struts.apache.org/2.x/docs/reset.html mentions the attribute action. Is this a doc error? Baubak Gandomi -Original Message- From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] Sent: lundi 9 mai 2011 15:22 To: Struts Users Mailing List Subject: Re: where does s:reset action=X go? On 9 May 2011 15:06, Baubak Gandomi b.gand...@castsoftware.com wrote: Does anyone know when the action attribute of s:reset is used/invoked? Never, maybe s:button is the best candidate in order to obtain what you're looking for. -- Maurizio Cucchiara - 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
RE: where does s:reset action=X go?
Thanks all This does seem to be plausible. -Original Message- From: Dave Newton [mailto:davelnew...@gmail.com] Sent: lundi 9 mai 2011 16:26 To: Struts Users Mailing List Subject: Re: where does s:reset action=X go? Yeah, all the UI components extend a base that have a bunch of attributes, not all of which make sense for each UI components. Dave On Mon, May 9, 2011 at 10:19 AM, Maurizio Cucchiara maurizio.cucchi...@gmail.com wrote: Maybe this docs was auto generated and action is inherited from another component. On 9 May 2011 15:41, Baubak Gandomi b.gand...@castsoftware.com wrote: Thanks for the answer. I'll take a look at s:button then. But the reason I ask is that the documentation : http://struts.apache.org/2.x/docs/reset.html mentions the attribute action. Is this a doc error? Baubak Gandomi -Original Message- From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] Sent: lundi 9 mai 2011 15:22 To: Struts Users Mailing List Subject: Re: where does s:reset action=X go? On 9 May 2011 15:06, Baubak Gandomi b.gand...@castsoftware.com wrote: Does anyone know when the action attribute of s:reset is used/invoked? Never, maybe s:button is the best candidate in order to obtain what you're looking for. -- Maurizio Cucchiara - 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 -- Maurizio Cucchiara - 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