response.sendRedirect() with Struts2 within a portlet
Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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: response.sendRedirect() with Struts2 within a portlet
I have used redirect in struts.xml file in two ways as : 1. result name=home type=redirecthome.action/result 2. result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Groucho Marx http://www.brainyquote.com/quotes/authors/g/groucho_marx.html - A hospital bed is a parked taxi with the meter running. On Sun, May 31, 2009 at 1:50 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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: How to make readonly textfield in Struts 2.0.11.2 datetimepicker
I have achieved this by use of JavaScript as follows: //2009-06-05T00:00:00 var validDate = /^([\d]{4})-([\d]{2})-([\d]{2})T([\d]{2})\:([\d]{2})\:([\d]{2})$/i; var elements = document.getElementsByName('dateOfBirth'); for(var i = 0; i elements.length; i++){ //alert('element:'+i +' element.value:'+ elements[i].value); if(!(validDate.test(elements[i].value))){ //here i am showing a error message, you can alert also. document.getElementById('registration_error_date_of_birth_required').style.display = ; isError = 1; } if(isError){ break; } } ... ... This function is called on submit of the form. But i would like to know if there is a way in Struts to control the user entry in the textbox. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com W. C. Fields http://www.brainyquote.com/quotes/authors/w/w_c_fields.html - I am free of all prejudices. I hate every one equally. On Sat, May 30, 2009 at 11:28 AM, Girish Naik girish.n...@gmail.com wrote: There is no readonly attribute in s:datetimepicker tag. I am using the following tag s:datetimepicker id=registration_date_of_birth_field name=dateOfBirth labelposition=left type=date toggleDuration=2000 toggleType=fade disabled=true required=true displayFormat=-MM-dd'T'HH:mm:ss weekStartsOn=1 / PFA for the rendered UI for the above tag. Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. On Fri, May 29, 2009 at 11:37 PM, Jim Collings jlistn...@gmail.comwrote: I just did this a while ago. All I had to do was set: readonly=true on the struts textfield tag. Mine doesn't have an icon though. On Fri, May 29, 2009 at 2:00 PM, Girish Naik girish.n...@gmail.com wrote: Hi, I have used struts2-core-2.0.11.2 in My Application. And intend to use the Struts date time picker, but the text field is coming as an editable field. I want to make it as a readonly textbox. The funny thing is that the dojo is not ready to pass my id to the textbox. Only name is supplied to the text box. Any suggesstions on how to make the textbox non editable and only the icon clickable? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:errors/ error validation error
coolsayan wrote: html:errors property=error.name.required / From the docs: Name of the property for which error messages should be displayed. If not specified, all error messages (regardless of property) are displayed. You don't have a property named error.name.required--that sounds like the name of a message resource to me. You have password and name properties. %@ taglib uri=http://struts.apache.org/tags-html; prefix=bean % %@ taglib uri=http://struts.apache.org/tags-html; prefix=html % You're using the same URI for two different taglibs. While this will work, it's probably not what you want. I don't see any uses of bean tags, so you can just delete the wrong one, or fix it. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
how would 'if' help with 'next'. can you please give an example? On Sun, May 31, 2009 at 12:58 AM, Musachy Barroso musa...@gmail.com wrote: duh..I sometimes read the whole email, believe me :). I have had a couple of scenarios where break would be nice, but I always go around it using if, same thing for next, just more often. musachy On Sat, May 30, 2009 at 8:10 PM, Bhaarat Sharma bhaara...@gmail.com wrote: Musachy, I think you have the wrong impression. This is not a 'break' tag...this would work same as in iterator tag BUT would also have a functionality where the user can go to the next element within the iteration. Thanks On Sat, May 30, 2009 at 11:46 AM, Musachy Barroso musa...@gmail.com wrote: I will take a look at it when I have a chance, this would be very easy to implement. musachy On Sat, May 30, 2009 at 11:45 AM, Musachy Barroso musa...@gmail.com wrote: I would suggest you to write a new tag, as a patch to struts core (look at the other tags, all you need is 2 classes and a couple of annotations). What this break tag would need to do is find the parent iterator tag, and somehow let it know that the iteration is over. musachy On Sat, May 30, 2009 at 10:51 AM, Martin Gainty mgai...@hotmail.com wrote: Bharaat did you get a change to read musachy's tag developer guide http://struts.apache.org/2.0.14/docs/tag-developers-guide.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: Sat, 30 May 2009 08:51:17 -0400 Subject: Re: why doesnt iterator tag provide 'next' From: bhaara...@gmail.com To: user@struts.apache.org I actually would like to make a custom tag out of this as I think it might be helpful to others as well. However, I cant find any good documentation on how to create one. I have 'Struts2 web 2.0 projects' book by Ian Roughly and it does not show how to create your own custom tags. I believe If I were to create a custom tag for this I will take most of the code from the iterator tag and just add a few bits to it? Can someone please just exaplain some steps that are involved in making a custom tag? Thanks -bhaarat On Sat, May 30, 2009 at 8:00 AM, Martin Gainty mgai...@hotmail.com wrote: Good Morning Bharaat struts tags have an extensible design which can be expanded for future requirements can you suggest a testcase to implement this functionality? thanks, 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: Sat, 30 May 2009 00:25:16 -0400 From: newton.d...@yahoo.com To: user@struts.apache.org Subject: Re: why doesnt iterator tag provide 'next' Bhaarat Sharma wrote: Iterator it = myList.iterator() while
Re: why doesnt iterator tag provide 'next'
Bhaarat Sharma wrote: how would 'if' help with 'next'. can you please give an example? Pseudocode Java; this is something people should be able to figure out for themselves. In JSP I might just use the index. for (Foo curr : foos) { if (alt) { ... } else prev = curr; alt = !alt; } OTOH, I'd probably never *need* to do this. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
sadly in my case i need to :( But this takes us back, the pseudocode you are suggesting is not possible using s:iterate, I dont think we have the ability to move the cursor (or current value in top stack) withtin the iterator tag. Neither does jstl provide this. So sadly, will my code have to sit back in time and use scriptlets. On Sun, May 31, 2009 at 9:49 AM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: how would 'if' help with 'next'. can you please give an example? Pseudocode Java; this is something people should be able to figure out for themselves. In JSP I might just use the index. for (Foo curr : foos) { if (alt) { ... } else prev = curr; alt = !alt; } OTOH, I'd probably never *need* to do this. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Bhaarat Sharma wrote: sadly in my case i need to :( But this takes us back, the pseudocode you are suggesting is not possible using s:iterate, I dont think we have the ability to move the cursor (or current value in top stack) withtin the iterator tag. Neither does jstl provide this. So sadly, will my code have to sit back in time and use scriptlets. Where does my code do anything with the iterator/cursor? I'll write it out even more: Foo prev; boolean alt = false; for (Foo curr : foos) { if (alt) { // Do something with prev and curr. } else prev = curr; alt = !alt; } Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Assuming that you're iterating over a List, why not instead iterate over a List of Integers, and use those Integers as the index to your iterator? You can increment the counter inside the iterator. Or if you need to get foo[0] and foo[1] on the first run through, foo[2] and foo[3] on the next run, you could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and dataList [i + 1]. It's easy enough to dynamically generate the List of Integers in your action class. jk On Sun, May 31, 2009 at 9:58 AM, Bhaarat Sharma bhaara...@gmail.com wrote: sadly in my case i need to :( But this takes us back, the pseudocode you are suggesting is not possible using s:iterate, I dont think we have the ability to move the cursor (or current value in top stack) withtin the iterator tag. Neither does jstl provide this. So sadly, will my code have to sit back in time and use scriptlets. On Sun, May 31, 2009 at 9:49 AM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: how would 'if' help with 'next'. can you please give an example? Pseudocode Java; this is something people should be able to figure out for themselves. In JSP I might just use the index. for (Foo curr : foos) { if (alt) { ... } else prev = curr; alt = !alt; } OTOH, I'd probably never *need* to do this. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Jim Kiley Senior Technical Consultant | Summa [p] 412.258.3346 http://www.summa-tech.com
Re: why doesnt iterator tag provide 'next'
Jim Kiley wrote: Assuming that you're iterating over a List, why not instead iterate over a List of Integers, and use those Integers as the index to your iterator? You can increment the counter inside the iterator. Or if you need to get foo[0] and foo[1] on the first run through, foo[2] and foo[3] on the next run, you could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and dataList [i + 1]. It's easy enough to dynamically generate the List of Integers in your action class. Yep--that was the just use the index bit, but I'm grumpy today and didn't feel like spelling it out :) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
I figured. The solution to I can't solve this problem is rarely let's add a new tag to the framework. jk On Sun, May 31, 2009 at 10:08 AM, Dave Newton newton.d...@yahoo.com wrote: Jim Kiley wrote: Assuming that you're iterating over a List, why not instead iterate over a List of Integers, and use those Integers as the index to your iterator? You can increment the counter inside the iterator. Or if you need to get foo[0] and foo[1] on the first run through, foo[2] and foo[3] on the next run, you could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and dataList [i + 1]. It's easy enough to dynamically generate the List of Integers in your action class. Yep--that was the just use the index bit, but I'm grumpy today and didn't feel like spelling it out :) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Jim Kiley Senior Technical Consultant | Summa [p] 412.258.3346 http://www.summa-tech.com
Re: why doesnt iterator tag provide 'next'
Jim Kiley wrote: I figured. The solution to I can't solve this problem is rarely let's add a new tag to the framework. Wouldn't mind break or continue, though--I might use those sometimes. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
cool, Jim, thats a better solution!! So I'll have something like this to create my iteratorList int sizeList = dataList.size(); List iterList = new ArrayList(); for (i = 0; i = sizeList; i=i+2) { iterList.add(i); } So now I have a iterList. I can iterate over it in my struts2 code s:iterate value=iterList statue=stat s:property value=((myClass)dataList.get(stat)).someClassMethod/ !--first item of dataList - s:property value=((myClass)dataList.get(stat+1)).someClassMethod/ !--second item of dataList - /s:iterate Will this work in regards to struts2 html tags? On Sun, May 31, 2009 at 10:08 AM, Dave Newton newton.d...@yahoo.com wrote: Jim Kiley wrote: Assuming that you're iterating over a List, why not instead iterate over a List of Integers, and use those Integers as the index to your iterator? You can increment the counter inside the iterator. Or if you need to get foo[0] and foo[1] on the first run through, foo[2] and foo[3] on the next run, you could iterate over a List {0, 2, 4, 6, 8...} and get dataList[i] and dataList [i + 1]. It's easy enough to dynamically generate the List of Integers in your action class. Yep--that was the just use the index bit, but I'm grumpy today and didn't feel like spelling it out :) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Dave Newton wrote: Wouldn't mind break or continue, though--I might use those sometimes. Taking a look at org.apache.struts2.components.IteratorComponent makes me think it wouldn't be too tough to add another tag that's only valid somewhere inside an iterator that would enable something like the following to work: table tr thColumn 1/th thColumn 2/th thColumn 3/th /tr s:iterator value=%{someList} tr tds:property //td s:iterNext tds:property //td /s:iterNext s:iterNext tds:property //td /s:iterNext /tr /s:iterator /table That output can otherwise be difficult to construct... -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Bhaarat Sharma wrote: So I'll have something like this to create my iteratorList int sizeList = dataList.size(); List iterList = new ArrayList(); for (i = 0; i = sizeList; i=i+2) { iterList.add(i); } So now I have a iterList. I can iterate over it in my struts2 code s:iterate value=iterList statue=stat s:property value=((myClass)dataList.get(stat)).someClassMethod/ !--first item of dataList - s:property value=((myClass)dataList.get(stat+1)).someClassMethod/ !--second item of dataList - /s:iterate You can do this completely within the jsp in a number of ways: s:iterator value=%{(dataList.size()).{?(#this%2)==(#this/2)}} /s:iterator s:iterator value=%{datalist} status=iterStatus s:if test=#rowstatus.odd == true ... /s:if s:else ... /s:else /s:iterator s:iterator begin=%{1} end=%{dataList.size()} step=%{2} /s:iterator -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Bhaarat Sharma wrote: s:iterate value=iterList statue=stat s:property value=((myClass)dataList.get(stat)).someClassMethod/ s:property value=((myClass)dataList.get(stat+1)).someClassMethod/ /s:iterate s:iterate value=iterList var=stat s:property value=dataList[#stat].someClassMethod()/ s:property value=dataList[#stat+1].someClassMethod()/ /s:iterate Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
Dale Newfield wrote: s:iterator value=%{(dataList.size()).{?(#this%2)==(#this/2)}} Heeheehee. That makes me feel all warm and fuzzy inside. I love abusing OGNL, although at my current gig I'm banned :/ s:iterator value=%{datalist} status=iterStatus s:if test=#rowstatus.odd == true ... /s:if s:else ... /s:else /s:iterator That was my pseudo-code solution, but it got shot down :'( s:iterator begin=%{1} end=%{dataList.size()} step=%{2} Oh, right! I wish I could remember they're there. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts 2 going to hang glassfish
Hello to all I have a project with Struts 2 ,Dojo , EJB 3 on glassfish 2.1 but when i click more than on one link OR when user switch IE8 to IE7 glassfish going to down! Please help me urgently Thank you
RE: Struts 2 going to hang glassfish
please display contents of $GLASSFISH_HOME\domains\domain1\logs\server.log 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. From: mohsen@gmail.com Date: Sun, 31 May 2009 09:05:17 -0700 Subject: Struts 2 going to hang glassfish To: user@struts.apache.org Hello to all I have a project with Struts 2 ,Dojo , EJB 3 on glassfish 2.1 but when i click more than on one link OR when user switch IE8 to IE7 glassfish going to down! Please help me urgently Thank you _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
RE: response.sendRedirect() with Struts2 within a portlet
Girish- can you provide the documentation which suggests Result and Result with params for redirect and redirect-action types? Thanks! Martin Gainty I would never join a club which would have me as a member - Groucho Marx __ 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: Sun, 31 May 2009 13:56:24 +0530 Subject: Re: response.sendRedirect() with Struts2 within a portlet From: girish.n...@gmail.com To: user@struts.apache.org I have used redirect in struts.xml file in two ways as : 1. result name=home type=redirecthome.action/result 2. result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Groucho Marx http://www.brainyquote.com/quotes/authors/g/groucho_marx.html - A hospital bed is a parked taxi with the meter running. On Sun, May 31, 2009 at 1:50 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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 _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
Re: [s2] strange (for me) OGNL behavior
Martin, thanks a lot! Martin Gainty schrieb: WEB-INF/classes/struts-default.xml interceptors interceptor name=params class=com.opensymphony.xwork2.interceptor.ParametersInterceptor/ interceptor-stack name=paramsPrepareParamsStack interceptor-ref name=exception/ interceptor-ref name=alias/ interceptor-ref name=i18n/ interceptor-ref name=params param name=excludeParamsdojo\..*,^struts\..*/param /interceptor-ref add exclude param after ^struts\..* e.g. ^struts\..*,name does this help? Martin __ Verzicht und Vertraulichkeitanmerkung 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. Date: Sat, 30 May 2009 10:33:53 +0200 From: kindl...@arcor.de To: user@struts.apache.org Subject: Re: [s2] strange (for me) OGNL behavior Musachy, that sounds interesting. Can you tell me where I find information about configuring (in struts-config.xml? or programmatically?) the interceptor? Thanks Martin Musachy Barroso schrieb: You can configure the params interceptor to ignore those params. musachy On Fri, May 29, 2009 at 9:00 AM, kindl...@arcor.de wrote: Thanks Jim, that is the explanation I needed. I can't get rid of the name attribute, but I can live with the stack traces in my log file. Martin - Original Nachricht Von: Jim Kiley jhki...@summa-tech.com An: Struts Users Mailing List user@struts.apache.org Datum: 29.05.2009 14:45 Betreff: Re: [s2] strange (for me) OGNL behavior Whenever you click an HTML button with your mouse, the browser will submit the X and Y coordinates of the area that you clicked. This is to support image maps. By giving the submit button a name (I think), the browser tries to provide those X and Y coordinates with respect to the button's name (thus name.x and name.y). Struts is trying to parse those input parameters but because you probably don't have an object in your action class that has the name that your submit button has, it is lost. This error won't actually cause you any real problems, but if you want to get rid of it I think you'll want to get rid of the 'name' attribute on your submit button. jk On Fri, May 29, 2009 at 5:46 AM, kindl...@arcor.de wrote: Hi, OGNL is a great mystery for me. It does magic and - well - strange things. :-) Perhaps you can help me out. The situation: I have a S2 (2.16) site where I use on some pages a form like this: s:form action=SatImgWetterSWR acceptcharset=UTF-8 s:textfield id=plzs_searchterm name=plzs_searchterm value=PLZ/Ort eingeben cssClass=dimmedInput onfocus=setActiveClass();/ s:submit type=image src=pages/img/nav/dosearch.gif id=plzs_submit name=plzs_submit cssStyle=margin-left: 5px; / /s:form This works great. The problem: when pressing the Submit-button, Struts throws exceptions that it (OGNL) cannot set the properties x and y which do not exist. This does not stop my app from working, its just ugly. Looking a bit into the problem I found that the form tries to transfer plzs_submit.x and plzs_submit.y and this causes the problem. I am puzzled. Any explanation and hint for stopping this will be greatly appreciated. Martin +--- Dipl. inf. Martin Kindler Julius-Leber-Str. 8 D-76448 Durmersheim Tel. +49 (0)7245 80 48 774 GSM +49 (0)160 977 636 14 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Jim Kiley Senior Technical Consultant | Summa [p] 412.258.3346 http://www.summa-tech.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 _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 going to hang glassfish
Hello glassfish can't write any thing in server.log before going to hang and if i clear the server.log this wil empty! 2009/5/31 Martin Gainty mgai...@hotmail.com please display contents of $GLASSFISH_HOME\domains\domain1\logs\server.log 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. From: mohsen@gmail.com Date: Sun, 31 May 2009 09:05:17 -0700 Subject: Struts 2 going to hang glassfish To: user@struts.apache.org Hello to all I have a project with Struts 2 ,Dojo , EJB 3 on glassfish 2.1 but when i click more than on one link OR when user switch IE8 to IE7 glassfish going to down! Please help me urgently Thank you _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
Re: response.sendRedirect() with Struts2 within a portlet
Crishantha Nanayakkara wrote: Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Er, ServletResponseAware, although I'm not sure if that's the cleanest approach to take (I know essentially nothing about portlets). Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: response.sendRedirect() with Struts2 within a portlet
There is no documentation as such, but i read it in the book 'Struts 2 Design and Programming: A Tutorial' by Budi Kurniawan. This result is added to the action mapping in struts.xml file - e.g.: *action name=login class=com.something.webapp.action.LoginAction method=login result name=success type=redirecthome.action/result result name=sign_in type=tiles tiles:showLoginPage /result result name=home type=redirecthome.action/result result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result /action* Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Helen Rowlandhttp://www.brainyquote.com/quotes/authors/h/helen_rowland.html - One man's folly is another man's wife. On Sun, May 31, 2009 at 9:50 PM, Martin Gainty mgai...@hotmail.com wrote: Girish- can you provide the documentation which suggests Result and Result with params for redirect and redirect-action types? Thanks! Martin Gainty I would never join a club which would have me as a member - Groucho Marx __ 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: Sun, 31 May 2009 13:56:24 +0530 Subject: Re: response.sendRedirect() with Struts2 within a portlet From: girish.n...@gmail.com To: user@struts.apache.org I have used redirect in struts.xml file in two ways as : 1. result name=home type=redirecthome.action/result 2. result name=failure type=redirect-action param name=namespace//param param name=actionNamehome/param /result Regards, - Girish Naik Mobile:-+91-09740091638 girish.n...@gmail.com Groucho Marx http://www.brainyquote.com/quotes/authors/g/groucho_marx.html - A hospital bed is a parked taxi with the meter running. On Sun, May 31, 2009 at 1:50 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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 _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
RE: [s2] strange (for me) OGNL behavior
i assumed since your name is martin you are the most intelligent engineer in germany? Mit Freundliche Gruben! Martin __ Verzicht und Vertraulichkeitanmerkung 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. Date: Sun, 31 May 2009 18:27:00 +0200 From: kindl...@arcor.de To: user@struts.apache.org Subject: Re: [s2] strange (for me) OGNL behavior Martin, thanks a lot! Martin Gainty schrieb: WEB-INF/classes/struts-default.xml interceptors interceptor name=params class=com.opensymphony.xwork2.interceptor.ParametersInterceptor/ interceptor-stack name=paramsPrepareParamsStack interceptor-ref name=exception/ interceptor-ref name=alias/ interceptor-ref name=i18n/ interceptor-ref name=params param name=excludeParamsdojo\..*,^struts\..*/param /interceptor-ref add exclude param after ^struts\..* e.g. ^struts\..*,name does this help? Martin __ Verzicht und Vertraulichkeitanmerkung 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. Date: Sat, 30 May 2009 10:33:53 +0200 From: kindl...@arcor.de To: user@struts.apache.org Subject: Re: [s2] strange (for me) OGNL behavior Musachy, that sounds interesting. Can you tell me where I find information about configuring (in struts-config.xml? or programmatically?) the interceptor? Thanks Martin Musachy Barroso schrieb: You can configure the params interceptor to ignore those params. musachy On Fri, May 29, 2009 at 9:00 AM, kindl...@arcor.de wrote: Thanks Jim, that is the explanation I needed. I can't get rid of the name attribute, but I can live with the stack traces in my log file. Martin - Original Nachricht Von: Jim Kiley jhki...@summa-tech.com An: Struts Users Mailing List user@struts.apache.org Datum: 29.05.2009 14:45 Betreff: Re: [s2] strange (for me) OGNL behavior Whenever you click an HTML button with your mouse, the browser will submit the X and Y coordinates of the area that you clicked. This is to support image maps. By giving the submit button a name (I think), the browser tries to provide those X and Y coordinates with respect to the button's name (thus name.x and name.y). Struts is trying to parse those input parameters but because you probably don't have an object in your action class that has the name that your submit button has, it is lost. This error won't actually cause you any real problems, but if you want to get rid of it I think you'll want to get rid of the 'name' attribute on your submit button. jk On Fri, May 29, 2009 at 5:46 AM, kindl...@arcor.de wrote: Hi, OGNL is a great mystery for me. It does magic and - well - strange things. :-) Perhaps you can help me out. The situation: I have a S2 (2.16) site where I use on some pages a form like this: s:form action=SatImgWetterSWR acceptcharset=UTF-8 s:textfield id=plzs_searchterm name=plzs_searchterm value=PLZ/Ort eingeben cssClass=dimmedInput onfocus=setActiveClass();/ s:submit type=image src=pages/img/nav/dosearch.gif id=plzs_submit name=plzs_submit cssStyle=margin-left: 5px; / /s:form This works great. The problem: when pressing the Submit-button, Struts throws exceptions that it (OGNL) cannot set the properties x and y which do not exist. This does not stop my app from working, its just ugly. Looking a bit into the problem I found that the form tries to transfer plzs_submit.x and plzs_submit.y and this causes the problem. I am puzzled. Any explanation and hint for stopping this will be greatly appreciated. Martin +--- Dipl. inf. Martin Kindler Julius-Leber-Str. 8 D-76448 Durmersheim Tel. +49 (0)7245 80 48 774 GSM +49 (0)160 977 636 14 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional
Re: response.sendRedirect() with Struts2 within a portlet
You can use the PortletResponseAware to get the portlet response object. Nnils-H On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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
Re: Struts 2 going to hang glassfish
I'm sure you realize that for anyone to be able to help, you have to provide some more information... Besides, I'd be surprised if you can't find any trace of anything in your logs. Nils-H On Sun, May 31, 2009 at 6:05 PM, mohsen ahmadian mohsen@gmail.com wrote: Hello to all I have a project with Struts 2 ,Dojo , EJB 3 on glassfish 2.1 but when i click more than on one link OR when user switch IE8 to IE7 glassfish going to down! Please help me urgently Thank you - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: customize fielderror
Hi all! I had the same problem here and I wrote the following code to avoid change the default struts template: s:if test=fieldErrors.get('email').size() 0s:property value=fieldErrors.get('email').get(0) //s:if newton.dave wrote: manub wrote: Yes. s:fielderror renders also ul and li tag, and I don't need them. I'm in need of a way to showing only the errors for a specific field without having any HTML tag (I need only the plain text). You'd either need to create/extend/modify the theme, use CSS, or just do it manually. Dave - 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://www.nabble.com/customize-fielderror-tp21990061p23806475.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: response.sendRedirect() with Struts2 within a portlet
Hi Nils-H, I got it working by using ActionResponse aResponse = PortletActionContext.getActionResponse(); within the execute() method of the action event. Actually my main requirement is to redirect to an external URL within my portlet itself. For me to confine the external URL within the portlet window, I am using the Struts2 Ajax div tag within my jsp code. See the JSP code below, sx:head debug=false cache=false compressed=false / s:url id=url action=testUrl1 portletUrlType=action/ body s:div id=div/ s:submit value=Make Request id=submit / sx:bind targets=div sources=submit events=onclick href=%{#url} / /body My execute() method looks like below, public String execute() throws Exception { System.out.println(*** In the EXECUTE() method ); System.out.println(The request object is : + request); ActionRequest aRequest = PortletActionContext.getActionRequest(); System.out.println(The Action request object is : + aRequest); ActionResponse aResponse = PortletActionContext.getActionResponse(); System.out.println(The Action response object is : + aResponse); aResponse.sendRedirect(http://www.google.lk;); return SUCCESS; } However, when I run this, The external URL is not loaded to the portlet window. It says undefined within div tags. What should I do to make this work? Best Regards Crishantha Nils-Helge Garli wrote: You can use the PortletResponseAware to get the portlet response object. Nnils-H On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23806654.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: response.sendRedirect() with Struts2 within a portlet
Unfortunately, you can't make an ajax request to the portlet. The ajax tags are not supported in a portlet, due to limitations in the JSR168 specification. Also, I'm not quite sure what you're trying to do. Are you attempting to load the div with Ajax with contents from a different url? Have you considered using an iframe? Nils-H On Sun, May 31, 2009 at 10:32 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi Nils-H, I got it working by using ActionResponse aResponse = PortletActionContext.getActionResponse(); within the execute() method of the action event. Actually my main requirement is to redirect to an external URL within my portlet itself. For me to confine the external URL within the portlet window, I am using the Struts2 Ajax div tag within my jsp code. See the JSP code below, sx:head debug=false cache=false compressed=false / s:url id=url action=testUrl1 portletUrlType=action/ body s:div id=div/ s:submit value=Make Request id=submit / sx:bind targets=div sources=submit events=onclick href=%{#url} / /body My execute() method looks like below, public String execute() throws Exception { System.out.println(*** In the EXECUTE() method ); System.out.println(The request object is : + request); ActionRequest aRequest = PortletActionContext.getActionRequest(); System.out.println(The Action request object is : + aRequest); ActionResponse aResponse = PortletActionContext.getActionResponse(); System.out.println(The Action response object is : + aResponse); aResponse.sendRedirect(http://www.google.lk;); return SUCCESS; } However, when I run this, The external URL is not loaded to the portlet window. It says undefined within div tags. What should I do to make this work? Best Regards Crishantha Nils-Helge Garli wrote: You can use the PortletResponseAware to get the portlet response object. Nnils-H On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23806654.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
RE: customize fielderror
can we assume fieldErrors is some sort of ListE ? http://java.sun.com/javase/6/docs/api/java/util/List.html#get(int) (would be easier to follow example if we could see referenced variables) thanks, 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: Sun, 31 May 2009 13:07:19 -0700 From: gutostra...@gmail.com To: user@struts.apache.org Subject: Re: customize fielderror Hi all! I had the same problem here and I wrote the following code to avoid change the default struts template: s:if test=fieldErrors.get('email').size() 0s:property value=fieldErrors.get('email').get(0) //s:if newton.dave wrote: manub wrote: Yes. s:fielderror renders also ul and li tag, and I don't need them. I'm in need of a way to showing only the errors for a specific field without having any HTML tag (I need only the plain text). You'd either need to create/extend/modify the theme, use CSS, or just do it manually. Dave - 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://www.nabble.com/customize-fielderror-tp21990061p23806475.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 _ Insert movie times and more without leaving Hotmail®. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
Re: customize fielderror
Martin Gainty wrote: can we assume fieldErrors is some sort of ListE ? http://java.sun.com/javase/6/docs/api/java/util/List.html#get(int) No, fieldErrors is a map, the entries of which are a list--as the JSP snippet implied, and as in the docs. s:if test=fieldErrors.get('email').size() 0s:property value=fieldErrors.get('email').get(0) //s:if (would be easier to follow example if we could see referenced variables) What referenced variables? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: why doesnt iterator tag provide 'next'
yeah, they would be useful. On Sun, May 31, 2009 at 10:20 AM, Dave Newton newton.d...@yahoo.com wrote: Jim Kiley wrote: I figured. The solution to I can't solve this problem is rarely let's add a new tag to the framework. Wouldn't mind break or continue, though--I might use those sometimes. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: customize fielderror
velocity example which references parameters.name index resolution for fieldErrors #*--example from controlheader.vm *# ## Only show message if errors are available. This will be done if ActionSupport is used. #if( $fieldErrors.get($parameters.name) ) #OGNL stack finds a fieldError depending on value extracted from 'bean' form name=myForm action=${validationAction} method=POST input type=hidden name=validationAction value=${validationAction}/ Action Properties: br table #tag( TextField label=Name name=name value=name ) /table Bean Properties: #if( $stack.findValue(fieldErrors) ) #set( $beanErrors = $stack.findValue(fieldErrors.get('bean')) ) //bean is encapsulated ValidatedBean contained within Action Class as referenced here //it must exist for fieldErrors.get('bean') to resolve correctly public class ValidatedAction extends ActionSupport { private ValidatedBean bean = new ValidatedBean(); private String name; private String validationAction = basicValidation.action; public ValidatedBean getBean() { return bean; } public void setBean(ValidatedBean bean) { this.bean = bean; //a clear example of listing fieldErrors form action=${validationAction} method=POST input type=hidden name=validationAction value=${validationAction} / #if (fieldErrors?keys?seq_contains(name)) br/ font color=red bField Errors:/bbr/ ul #list fieldErrors.name as fieldError li${fieldError}/li /#list /ul /font /#if Action Properties: br/ table trtd Name:input type=text name=name / /td/tr /table Bean Properties: //reference individual Bean attributes and match fieldErrors according to bean attribute match #if ((fieldErrors?keys?seq_contains(bean.text)) || (fieldErrors?keys?seq_contains(bean.date)) || (fieldErrors?keys?seq_contains(bean.number))) br/ font color=red bBean Errors:/bbr/ ul #if fieldErrors?keys?seq_contains(bean.text) //wonderfully clear example of listing fieldErrors #list fieldErrors[bean.text] as beanTextError li${beanTextError}/li /#list /#if //finally an ActionSupport.addFieldError which allows you to add specific //actionErrors which correspond to known keys of field1, field2 public class MessageStoreInterceptorTest extends StrutsTestCase { 46 47 public void testStoreMessage() throws Exception { 48 MessageStoreInterceptor interceptor = new MessageStoreInterceptor(); 49 interceptor.setAllowRequestParameterSwitch(true); 50 interceptor.setOperationMode(MessageStoreInterceptor.STORE_MODE); 51 52 53 Map paramMap = new LinkedHashMap(); 54 Map sessionMap = new LinkedHashMap(); 55 56 ActionSupport action = new ActionSupport(); 57 action.addActionError(some action error 1); 58 action.addActionError(some action error 2); 59 action.addActionMessage(some action message 1); 60 action.addActionMessage(some action message 2); 61 action.addFieldError(field1, some field error 1); 62 action.addFieldError(field2, some field error 2); i could'nt see any of these examples with white font on white background in the posted example 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
Re: customize fielderror
O_o I have no idea why you posted that. Martin Gainty wrote: velocity example which references parameters.name index resolution for fieldErrors #*--example from controlheader.vm *# ## Only show message if errors are available. This will be done if ActionSupport is used. #if( $fieldErrors.get($parameters.name) ) #OGNL stack finds a fieldError depending on value extracted from 'bean' form name=myForm action=${validationAction} method=POST input type=hidden name=validationAction value=${validationAction}/ Action Properties: br table #tag( TextField label=Name name=name value=name ) /table Bean Properties: #if( $stack.findValue(fieldErrors) ) #set( $beanErrors = $stack.findValue(fieldErrors.get('bean')) ) //bean is encapsulated ValidatedBean contained within Action Class as referenced here //it must exist for fieldErrors.get('bean') to resolve correctly public class ValidatedAction extends ActionSupport { private ValidatedBean bean = new ValidatedBean(); private String name; private String validationAction = basicValidation.action; public ValidatedBean getBean() { return bean; } public void setBean(ValidatedBean bean) { this.bean = bean; //a clear example of listing fieldErrors form action=${validationAction} method=POST input type=hidden name=validationAction value=${validationAction} / #if (fieldErrors?keys?seq_contains(name)) br/ font color=red bField Errors:/bbr/ ul #list fieldErrors.name as fieldError li${fieldError}/li /#list /ul /font /#if Action Properties: br/ table trtd Name:input type=text name=name / /td/tr /table Bean Properties: //reference individual Bean attributes and match fieldErrors according to bean attribute match #if ((fieldErrors?keys?seq_contains(bean.text)) || (fieldErrors?keys?seq_contains(bean.date)) || (fieldErrors?keys?seq_contains(bean.number))) br/ font color=red bBean Errors:/bbr/ ul #if fieldErrors?keys?seq_contains(bean.text) //wonderfully clear example of listing fieldErrors #list fieldErrors[bean.text] as beanTextError li${beanTextError}/li /#list /#if //finally an ActionSupport.addFieldError which allows you to add specific //actionErrors which correspond to known keys of field1, field2 public class MessageStoreInterceptorTest extends StrutsTestCase { 46 47 public void testStoreMessage() throws Exception { 48 MessageStoreInterceptor interceptor = new MessageStoreInterceptor(); 49 interceptor.setAllowRequestParameterSwitch(true); 50 interceptor.setOperationMode(MessageStoreInterceptor.STORE_MODE); 51 52 53 Map paramMap = new LinkedHashMap(); 54 Map sessionMap = new LinkedHashMap(); 55 56 ActionSupport action = new ActionSupport(); 57 action.addActionError(some action error 1); 58 action.addActionError(some action error 2); 59 action.addActionMessage(some action message 1); 60 action.addActionMessage(some action message 2); 61 action.addFieldError(field1, some field error 1); 62 action.addFieldError(field2, some field error 2); i could'nt see any of these examples with white font on white background in the posted example 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 à
Re: response.sendRedirect() with Struts2 within a portlet
Hi Nilis-H, Thanks a lot for the update. Yes, I am trying to redirect to an external URL by just clicking a submit button within a portlet. As you said for that I am attempting to load the div with Ajax with contents from the external URL specified purely to display it within the portlet window. Can I attempt IFrame to fulfill the same purpose? Best Regards Crishantha Nils-Helge Garli wrote: Unfortunately, you can't make an ajax request to the portlet. The ajax tags are not supported in a portlet, due to limitations in the JSR168 specification. Also, I'm not quite sure what you're trying to do. Are you attempting to load the div with Ajax with contents from a different url? Have you considered using an iframe? Nils-H On Sun, May 31, 2009 at 10:32 PM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi Nils-H, I got it working by using ActionResponse aResponse = PortletActionContext.getActionResponse(); within the execute() method of the action event. Actually my main requirement is to redirect to an external URL within my portlet itself. For me to confine the external URL within the portlet window, I am using the Struts2 Ajax div tag within my jsp code. See the JSP code below, sx:head debug=false cache=false compressed=false / s:url id=url action=testUrl1 portletUrlType=action/ body s:div id=div/ s:submit value=Make Request id=submit / sx:bind targets=div sources=submit events=onclick href=%{#url} / /body My execute() method looks like below, public String execute() throws Exception { System.out.println(*** In the EXECUTE() method ); System.out.println(The request object is : + request); ActionRequest aRequest = PortletActionContext.getActionRequest(); System.out.println(The Action request object is : + aRequest); ActionResponse aResponse = PortletActionContext.getActionResponse(); System.out.println(The Action response object is : + aResponse); aResponse.sendRedirect(http://www.google.lk;); return SUCCESS; } However, when I run this, The external URL is not loaded to the portlet window. It says undefined within div tags. What should I do to make this work? Best Regards Crishantha Nils-Helge Garli wrote: You can use the PortletResponseAware to get the portlet response object. Nnils-H On Sun, May 31, 2009 at 10:20 AM, Crishantha Nanayakkara c.nanayakk...@gmail.com wrote: Hi, I have a requirement to use a response.sendRedirect() within my Action class. Basically this action class is used to manipulate a porltet. Unlike Struts1, we do not directly have any processAction() method and ActionRequest and ActionResponse objects to do a response.sendRedirect. I just want to know how do we get about executing the response.sendRedirect with Struts2? What should be the interface to implement within the action class to do this. (Just like ServletRequestAware to get the HttpServletRequest) Appriciate your help on this. Best Regards Crishantha -- View this message in context: http://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23800916.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://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23806654.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://www.nabble.com/response.sendRedirect%28%29-with-Struts2-within-a-portlet-tp23800916p23809082.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