optiontransferselect don't use hidden input.
Hi all, With optiontransferselect, I am trying to get the list of double list but it is impossible if you dont select all them. I had seen an input hidden with __multiselect_ but it isn't filled properly. Thanks for all!
Dynamic text
Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Cheers, Marcus - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Dynamic text
-Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: optiontransferselect don't use hidden input.
On Tue, 2011-05-31 at 13:44 +0200, Alejandro wrote: Hi all, With optiontransferselect, I am trying to get the list of double list but it is impossible if you dont select all them. I had seen an input hidden with __multiselect_ but it isn't filled properly. Thanks for all! Can you post your .jsp and backing action please. In the mean time, check that you have included the s:head tag in your page. This drags in a small javascript file which the optiontransferselect tag needs to work properly Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: chain or redirectAction ResultType
So in the given below scenario what is the best approach so that the form values on UI get populated with hidden values/parameters? On 31-05-2011 08:07, Steven Yang wrote: chaining is not recommended. basically as you have observed, chaining is a server-side redirect. you go to another page without changing client's browser url. i have not seen a formal argument of the bad of it (or i forgot) but what i have observed is that the user may hit Reload on browser and get unexpected behavior for both the user and developer On Tue, May 31, 2011 at 5:13 AM, Sachin Lalelalesach...@gmail.com wrote: Hi, I am migrating an application from struts1.1 to struts 2.2.3. I have two action 1. InstitutuionAction : The purpose is to prepare the data required to display and then forward to a Institution.JSP (using tiles) 2. InstitutionAddEditAction: This action exposed two methods insert, update and validate. The insert and validate method of InstitutionAddEditAction class looks like below public String insert() throws Exception { log.info(In InstitutionStrutsAddEditAction+institution.getName()); return Action.SUCCESS; } public void validate() { if(institution.getName().equals(abc)) addActionError(font color=\red\ Invalid Name ./font); } struts.xml action name=Institution method=execute class=edu.wustl.clinportal.action.struts2.InstitutionStruts2Action result name=success type=tiles.clinportal.institutionDef/result result name=failure type=tiles.clinportal.institutionDef/result result name=access_denied/ManageAdministrativeData.do/result /action action name=InstitutionAddEdit_* method={1} class=edu.wustl.clinportal.action.struts2.InstitutionStrutsAddEditAction result name=input type=redirectAction param name=actionNameInstitution/param param name=operationadd/param param name=pageOfpageOfInstitution/param param name=menuSelected2/param /result result name=success type=redirectAction param name=actionNameInstitution/param /result /action After a validation error it is getting redirect to Institution.action but not re-populating the data entered by the users obvious reason as the request is redirected and not forward. Everything works fine if i replace the result type to chain and could populate the Institution name (this object is in InstitutionAddEditAction class). I added a Institution object in InstitutuionAction class. I tried the same scenarion using chain this time. Its worked as well. Is ChainInterceptor populating this object? But is using chain a recommended approach. What is harm in using chain.? Best regards, Sachin - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Dynamic text
Thanks for the link but still not quite what I'm looking for.. I've made a simple example below, however note that I am not extending ActionSupport in any of my actions: Action has method (could return different value than 'goodbye') public String getMyKey() { return goodbye; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: s:text name=hello / This works fine br / s:text name=%{getMyKey} / Nope br / s:text name=#getMyKey / Nope br / s:property value=getMyKey / This returns nothing br / s:property value=%{getMyKey} / This returns nothing br / s:property value=getText(#getMyKey) / This returns nothing br / On 31/05/2011 15:38, Jason Pyeron wrote: -Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - 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: Dynamic text
-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. -Original Message- From: Marcus Bond [mailto:mar...@marcusbond.me.uk] Sent: Tuesday, May 31, 2011 14:41 To: Struts Users Mailing List Subject: Re: Dynamic text Thanks for the link but still not quite what I'm looking for.. I've made a simple example below, however note that I am not extending ActionSupport in any of my actions: Action has method (could return different value than 'goodbye') public String getMyKey() { return goodbye; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: s:text name=hello / This works fine br / s:text name=%{getMyKey} / Nope br / s:text name=#getMyKey / Try: s:text name=%{myKey} /, it works for me with your example. If you want to call a method you should: s:text name=%{getMyKey()} / Nope br / s:property value=getMyKey / This returns nothing br / s:property value=%{getMyKey} / This returns nothing br / s:property value=getText(#getMyKey) / This returns nothing br / On 31/05/2011 15:38, Jason Pyeron wrote: -Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Dynamic text
Thanks Jason, s:text name=%{myKey} / Will be fine as normally it will just be a property to return not a method call.. The glaringly obvious error in hindsight was having left the 'get' part on the property name.. Doh! On 31/05/2011 19:56, Jason Pyeron wrote: -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. -Original Message- From: Marcus Bond [mailto:mar...@marcusbond.me.uk] Sent: Tuesday, May 31, 2011 14:41 To: Struts Users Mailing List Subject: Re: Dynamic text Thanks for the link but still not quite what I'm looking for.. I've made a simple example below, however note that I am not extending ActionSupport in any of my actions: Action has method (could return different value than 'goodbye') public String getMyKey() { return goodbye; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: s:text name=hello / This works finebr / s:text name=%{getMyKey} / Nopebr / s:text name=#getMyKey / Try:s:text name=%{myKey} /, it works for me with your example. If you want to call a method you should:s:text name=%{getMyKey()} / Nopebr / s:property value=getMyKey / This returns nothingbr / s:property value=%{getMyKey} / This returns nothingbr / s:property value=getText(#getMyKey) / This returns nothingbr / On 31/05/2011 15:38, Jason Pyeron wrote: -Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - 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 - 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: Dynamic text
!-- define your servlet to accept ApplicationResources -- servlet-class org.apache.struts.action.ActionServlet /servlet-class init-param param-name application /param-name param-value de.laliluna.tutorials.library.struts.ApplicationResources /param-value /init-param !-- define which ApplicationResource to access from list in param-name/param-value -- message-resources key=moreResources parameter=de.laliluna.tutorials.library.struts.MoreApplicationResources/!-- populate values in ApplicationResources.properties -- label.username=Username label.password=Password label.first.name=First Name label.last.name=Last Name label.email=Email Address label.phone.number=Phone Number label.welcome=Welcome back {0} {1}! error.min.length=The input must be at least {0} characters in length. error.max.length=The input cannot be longer than {0} characters in length.!-- in jsp use the bean:message tag to display contents of the attribute -- bean:message key=label.password/!-- there is an internationalisation interceptor from WW available in struts2 -- !-- this from the german site lailuna (originally targeted for Struts1) -- http://www.laliluna.de/articles/struts-message-resources-tutorial.html Martin __ 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: Tue, 31 May 2011 19:40:43 +0100 From: mar...@marcusbond.me.uk To: user@struts.apache.org Subject: Re: Dynamic text Thanks for the link but still not quite what I'm looking for.. I've made a simple example below, however note that I am not extending ActionSupport in any of my actions: Action has method (could return different value than 'goodbye') public String getMyKey() { return goodbye; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: s:text name=hello / This works fine br / s:text name=%{getMyKey} / Nope br / s:text name=#getMyKey / Nope br / s:property value=getMyKey / This returns nothing br / s:property value=%{getMyKey} / This returns nothing br / s:property value=getText(#getMyKey) / This returns nothing br / On 31/05/2011 15:38, Jason Pyeron wrote: -Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - 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: Dynamic text
-Original Message- From: Martin Gainty Sent: Tuesday, May 31, 2011 15:50 To: Struts Users Mailing List Subject: RE: Dynamic text snip/ !-- this from the german site lailuna (originally targeted for Struts1) -- http://www.laliluna.de/articles/struts-message-resources-tutorial.html His issue was not on where and how to access properties in struts2, but rather an OGNL issue of how to access his getter in the action in %{} notation. Martin snip/ Action has method (could return different value than 'goodbye') public String getMyKey() { return goodbye; } resource file has keys: hello=Hello There! goodbye=See you later! page has tags: s:text name=hello / This works fine br / s:text name=%{getMyKey} / Nope br / s:text name=#getMyKey / Nope br / s:property value=getMyKey / This returns nothing br / s:property value=%{getMyKey} / This returns nothing br / s:property value=getText(#getMyKey) / This returns nothing br / Note the use of %{getMyKey}... It should read as %{myKey} or %{getMyKey()} On 31/05/2011 15:38, Jason Pyeron wrote: -Original Message- From: Marcus Bond Sent: Tuesday, May 31, 2011 10:26 To: Struts Users Mailing List Subject: Dynamic text Hi, I want to use some view objects in my action that will contain resource keys and then show these using s:text to resolve the key to it's translation.. Is this type of thing supported? I know a lot of tags moan if you try and use any ${foo.bar} type arguments Have you taken a look at http://struts.apache.org/2.x/docs/localization.html yet? If so could you please post a specific problem? -Jason -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - 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 -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Separate Java Bean Class for Getter/Setter method.
Here is my whole code. implement ParameterAware. Declaration of MAP. Maplt;String, String[]gt; parameters = null; Call this method. getParameters(alId) public void setParameters(Maplt;String, String[]gt; params) { // TODO Auto-generated method stub this.parameters = params; } public String getParameters(String param) { StringBuffer sbVal = new StringBuffer(); paramVal = (String[]) parameters.get(param); for (int i = 0; i paramVal.length; i++) { sbVal.append(paramVal[i]); } return sbVal.toString(); } -- View this message in context: http://struts.1045723.n5.nabble.com/Separate-Java-Bean-Class-for-Getter-Setter-method-tp4385274p4442897.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: chain or redirectAction ResultType
I am not sure whats good for you because I usually put the logic for same page in the same Action. So for your case I would just write one Action. However I do understand the need of separating modification logic from pure display data logic. In your case you could at one param in redirectAction for each parameter you have so your Institution will get populated, but of course these parameters will be transferred via Get parameters and shown on the browser URL. or you could put them in session and take the values out when you get to Institution. These are the 2 ways i can think of write now. dont know if anyone else can suggest better way of doing these On Wed, Jun 1, 2011 at 12:34 AM, Sachin Lale lalesach...@gmail.com wrote: So in the given below scenario what is the best approach so that the form values on UI get populated with hidden values/parameters? On 31-05-2011 08:07, Steven Yang wrote: chaining is not recommended. basically as you have observed, chaining is a server-side redirect. you go to another page without changing client's browser url. i have not seen a formal argument of the bad of it (or i forgot) but what i have observed is that the user may hit Reload on browser and get unexpected behavior for both the user and developer On Tue, May 31, 2011 at 5:13 AM, Sachin Lalelalesach...@gmail.com wrote: Hi, I am migrating an application from struts1.1 to struts 2.2.3. I have two action 1. InstitutuionAction : The purpose is to prepare the data required to display and then forward to a Institution.JSP (using tiles) 2. InstitutionAddEditAction: This action exposed two methods insert, update and validate. The insert and validate method of InstitutionAddEditAction class looks like below public String insert() throws Exception { log.info(In InstitutionStrutsAddEditAction+institution.getName()); return Action.SUCCESS; } public void validate() { if(institution.getName().equals(abc)) addActionError(font color=\red\ Invalid Name ./font); } struts.xml action name=Institution method=execute class=edu.wustl.clinportal.action.struts2.InstitutionStruts2Action result name=success type=tiles.clinportal.institutionDef/result result name=failure type=tiles.clinportal.institutionDef/result result name=access_denied/ManageAdministrativeData.do/result /action action name=InstitutionAddEdit_* method={1} class=edu.wustl.clinportal.action.struts2.InstitutionStrutsAddEditAction result name=input type=redirectAction param name=actionNameInstitution/param param name=operationadd/param param name=pageOfpageOfInstitution/param param name=menuSelected2/param /result result name=success type=redirectAction param name=actionNameInstitution/param /result /action After a validation error it is getting redirect to Institution.action but not re-populating the data entered by the users obvious reason as the request is redirected and not forward. Everything works fine if i replace the result type to chain and could populate the Institution name (this object is in InstitutionAddEditAction class). I added a Institution object in InstitutuionAction class. I tried the same scenarion using chain this time. Its worked as well. Is ChainInterceptor populating this object? But is using chain a recommended approach. What is harm in using chain.? Best regards, Sachin - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org