Re: getText with multiple parameters not populating correctly

2019-04-02 Thread Affan Osman
Double single quotes did the trick. Thanks! On Apr 2, 2019, 10:59 AM -0400, Lukasz Lenart , wrote: > wt., 2 kwi 2019 o 16:54 Dave Newton napisał(a): > > > > Single-quotes must be escaped using double single-quotes; single quotes are > > used to allow non-resource strings. IIRC this is just how `Me

Re: getText with multiple parameters not populating correctly

2019-04-02 Thread Lukasz Lenart
wt., 2 kwi 2019 o 16:54 Dave Newton napisał(a): > > Single-quotes must be escaped using double single-quotes; single quotes are > used to allow non-resource strings. IIRC this is just how `MessageFormat` > works. Yeah... getText() is using MessageFormat so you must properly escape your messages

Re: getText with multiple parameters not populating correctly

2019-04-02 Thread Dave Newton
Single-quotes must be escaped using double single-quotes; single quotes are used to allow non-resource strings. IIRC this is just how `MessageFormat` works. On Tue, Apr 2, 2019 at 10:40 AM Affan Osman wrote: > I think found the issue. It fails because of '. > > test.key={0}is{1}and{2}. > test.ke

Re: getText with multiple parameters not populating correctly

2019-04-02 Thread Affan Osman
I think found the issue. It fails because of '. test.key={0}is{1}and{2}. test.key2={0}'sis{1}and{2}. String key1= getText("test.key", newString[] {"aa11", "bb22", "cc33"}); String key2= getText("test.key2", newString[] {"aa11", "bb22", "cc33"}); Key 1: aa11 is bb22 and cc33. Key 2: aa11s is {1}

Re: getText with multiple parameters not populating correctly

2019-04-02 Thread Lukasz Lenart
wt., 2 kwi 2019 o 04:46 Affan Osman napisał(a): > > I am using version 2.5.17. I am not using any custom text provider. > > I tried the same example as in the unit test but still only first parameter > gets populated. The second and third show as [1] and [2]. Could you share your struts.xml? Thi

Re: getText with multiple parameters not populating correctly

2019-04-01 Thread Affan Osman
I am using version 2.5.17. I am not using any custom text provider. I tried the same example as in the unit test but still only first parameter gets populated. The second and third show as [1] and [2]. Thanks. On Mar 31, 2019, 5:21 AM -0400, Lukasz Lenart , wrote: > sob., 30 mar 2019 o 20:03 Aff

Re: getText with multiple parameters not populating correctly

2019-03-31 Thread Lukasz Lenart
sob., 30 mar 2019 o 20:03 Affan Osman napisał(a): > > I am passing in three parameters to getText but only the first one gets > populated. > > getText("error.invalidcode", new String[] {"name", "num", "1az"}); > > And in my ApplicationResources.properties > > error.invalidcode={0} and {1} property

Re: getText in error messages: resource bundle or bean value?

2012-10-19 Thread J. Garcia
You are right! On Fri, Oct 19, 2012 at 2:54 PM, Hoying, Ken wrote: > I believe that your problem is that the field names are the same as your > label names and with the validator both are in the stack. > ${getText(user.password)} is first evaluating user.password and finding the > field value "12

RE: getText in error messages: resource bundle or bean value?

2012-10-19 Thread Hoying, Ken
I believe that your problem is that the field names are the same as your label names and with the validator both are in the stack. ${getText(user.password)} is first evaluating user.password and finding the field value "1234". getText is then trying to locate an entry for "1234" and cannot find

Re: getText in error messages: resource bundle or bean value?

2012-10-19 Thread J. Garcia
Mi mistake. Sorry. The resource error message I was using is in fact: errors.confirmPassSame=The ${user.confirmPassword} field has to have the same value as the ${user.password} field. whereas it should be: errors.confirmPassSame=The ${getText("user.confirmPassword")} field has to have the same

RE: getText syntax for jsp tags

2012-08-15 Thread Cozart, Michele L
Thanks René!! It works perfectly. ** The key attribute is for simple resource properties lookup only, without MessageFormat. The tag is able to deal with MessageFormat in particular. In your case you could either use specialized properties in your bundle: reject.t

Re: getText syntax for jsp tags

2012-08-14 Thread Rene Gielen
The key attribute is for simple resource properties lookup only, without MessageFormat. The tag is able to deal with MessageFormat in particular. In your case you could either use specialized properties in your bundle: reject.to=Reject to reject.to.larry=%{getText('reject.to')} Larry or use the

Re: getText returns NULL when formating number using l10n

2011-11-27 Thread Li Ying
If you want a definitive solution, i suggest you create a new method like: getTextEx(.) in your action, in this method, you can check the parameters, if they are null, change them to empty string, and then invoke the original getText method. you can put this method in the base class of you

Re: getText returns NULL when formating number using l10n

2011-11-22 Thread Felipe Issa
It's not a definitive solution, but it works. Thanks Li Ying! Em 21/11/2011 23:07, Li Ying escreveu: or you can do the null check in the jsp code, before you create the param list for the format string. Code like: 2011/11/22 Felipe Issa: Hi. I'm trying to internationalize my application,

Re: getText returns NULL when formating number using l10n

2011-11-21 Thread Li Ying
or you can do the null check in the jsp code, before you create the param list for the format string. Code like: 2011/11/22 Felipe Issa : > Hi. I'm trying to internationalize my application, and for that i need to > use the struts l10n. I have managed to parse the number according to the > us

Re: getText returns NULL when formating number using l10n

2011-11-21 Thread Li Ying
I have read the source of java.text.MessageFormat, looks like it output a "null" text to the result String when the argument is null. I think you can create a read-only property in your action (or your data model class), and implement the null check and format process in this property, code like:

Re: getText on XSLT transformation on an Action

2011-06-20 Thread Josep María Formentí Serra
; > would prefer otheer solution...if possible. > > > Sent via BlackBerry from T-Mobile > > > > > > -Original Message- > > > From: Chris Pratt > > > Date: Thu, 16 Jun 2011 22:24:33 > > > To: Struts Users Mailing List > > > Repl

Re: getText on XSLT transformation on an Action

2011-06-17 Thread JOSE L MARTINEZ-AVIAL
2011 22:24:33 > > To: Struts Users Mailing List > > Reply-To: "Struts Users Mailing List" > > Subject: Re: getText on XSLT transformation on an Action > > > > There's no reason the XSL should be dynamic. The XML is typically the > > dynamic part w

Re: getText on XSLT transformation on an Action

2011-06-17 Thread Chris Pratt
tt > Date: Thu, 16 Jun 2011 22:24:33 > To: Struts Users Mailing List > Reply-To: "Struts Users Mailing List" > Subject: Re: getText on XSLT transformation on an Action > > There's no reason the XSL should be dynamic. The XML is typically the > dynamic part with

Re: getText on XSLT transformation on an Action

2011-06-17 Thread Maurizio Cucchiara
Berry from T-Mobile > > -Original Message- > From: Chris Pratt > Date: Thu, 16 Jun 2011 22:24:33 > To: Struts Users Mailing List > Reply-To: "Struts Users Mailing List" > Subject: Re: getText on XSLT transformation on an Action > > There's no reaso

Re: getText on XSLT transformation on an Action

2011-06-17 Thread jlmagc
List" Subject: Re: getText on XSLT transformation on an Action There's no reason the XSL should be dynamic. The XML is typically the dynamic part with the XSL being static (so that it can be parsed and cached for efficiency). Why not include a section in the XML with the replace

Re: getText on XSLT transformation on an Action

2011-06-16 Thread Chris Pratt
There's no reason the XSL should be dynamic. The XML is typically the dynamic part with the XSL being static (so that it can be parsed and cached for efficiency). Why not include a section in the XML with the replacement text, then reference the strings using XPath? (*Chris*) On Thu, Jun 16, 2

Re: getText on XSLT transformation on an Action

2011-06-16 Thread Miguel
Yes, if you want this, you need to create the XSLT on the fly, You can use freemarker to achieve this. substituying the placeholders with the appropiate text. You can use even apache commons StringUtils if you only want to susbtitute placeholders with fixed text. Cheers, Si quieres ser más positi

Re: getText on XSLT transformation on an Action

2011-06-16 Thread JOSE L MARTINEZ-AVIAL
could you expand that? do you mean to create the XSLT on the fly? 2011/6/16 Maurizio Cucchiara > The first solution I thought is: a template engine. > Currently your xslt file is static, you should consider to make dynamic in > order to include dynamic content. > > Maurizio Cucchiara > > Il gior

Re: getText on XSLT transformation on an Action

2011-06-16 Thread Maurizio Cucchiara
The first solution I thought is: a template engine. Currently your xslt file is static, you should consider to make dynamic in order to include dynamic content. Maurizio Cucchiara Il giorno 16/giu/2011 19.37, "JOSE L MARTINEZ-AVIAL" ha scritto: > Hi, > I'm using Struts 2.1.8.1. I have an action

RE: getText

2011-03-30 Thread Jose Luis Martinez Avial
You can setup a locale in the session and Struts will use that for all your texts. -Original Message- From: franc...@rendezvouscentral.com [mailto:franc...@rendezvouscentral.com] Sent: Tuesday, March 29, 2011 6:26 PM To: user@struts.apache.org Subject: getText Hi Everybody is there a wa

RE: getText

2011-03-30 Thread franc...@rendezvouscentral.com
thx a lot it seems to be exactly what I need Francois Rouxel www.rendezvouscentral.com Original Message Subject: Re: getText From: Okan_Özeren_[via_Struts] < ml-node+4271219-775331120-194...@n5.nabble.com > Date: Wed, March 30, 2011 6:40 am To: &

Re: getText

2011-03-30 Thread Okan Özeren
Hi, Sometimes I use this method for getting a value of key from multilanguage resource bundles with localized which I want. Below method is into the *LocalizedTextUtil* class and * com.opensymphony.xwork2.util* package and *xwork-core-*.jar* which library you need as struts2 libraries depended.

Re: getText() from login.properties but not packages.properties

2010-01-20 Thread Bhaarat Sharma
login.properties has to be mentioned in you struts.properties file as struts.custom.i18n.resources=login Above means that login.properties resides in WEB-INF/classes On Wed, Jan 20, 2010 at 1:47 PM, Emi Lu wrote: > Lukasz Lenart wrote: > >> Please read documentation, everything is explained th

Re: getText() from login.properties but not packages.properties

2010-01-20 Thread Emi Lu
Lukasz Lenart wrote: Please read documentation, everything is explained there. http://struts.apache.org/2.1.8.1/docs/localization.html http://struts.apache.org/2.1.8.1/docs/strutsproperties.html This did not answer my question :( Using package.properties works fine for me. The problem is how

Re: getText() from login.properties but not packages.properties

2010-01-20 Thread Lukasz Lenart
Please read documentation, everything is explained there. http://struts.apache.org/2.1.8.1/docs/localization.html http://struts.apache.org/2.1.8.1/docs/strutsproperties.html Regards -- Lukasz Kapituła Javarsovia 2010 http://javarsovia.pl

Re: getText from an interceptor

2009-02-26 Thread Zarar Siddiqi
If your actions are extending ActionSupport than you can go like so: public String intercept(ActionInvocation invocation) throws Exception { String message = ((ActionSupport) invocation.getAction()).getText("resource.key") ... } Zarar On Thu, Feb 26, 2009 at 12:23 PM, Security M

RE: getText did not return value in s:submit

2009-02-18 Thread Martin Gainty
se content contained within this transmission. > Date: Thu, 5 Feb 2009 12:29:46 -0500 > From: em...@encs.concordia.ca > To: user@struts.apache.org; newton.d...@yahoo.com > Subject: Re: getText did not return value in s:submit > > Hi Dave, > > >> (3)

Re: getText did not return value in s:submit

2009-02-08 Thread Steven Yang
> > >> (2) Put package.properties under /WEB-INF/classes/ >> >> > have you tried to put package.properties under the same package as your action class?AFAIK package.properties only works with classes in the same package or classes sub-classing the classes in the package.

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
Finally, in JSP(not through action) success by doing the following: (1) Create "struts.properties" under WEB-INF/classes/ struts.custom.i18n.resources=globalMessages (2) Create globalMessages_en_US.properties label.test= test label value (3) in JSP, -- Lu Ying Emi Lu wrote: htt

Re: getText did not return value in s:submit

2009-02-05 Thread Dave Newton
Emi Lu wrote: http://t.wits.sg/2008/06/23/howto-struts-2-i18n/ Did not success. (1) in package.properties label.code=example value (2) Put package.properties under /WEB-INF/classes/ (3) in jsp Still cannot see the result? Again: are you accessing the JSP through an action? Dave

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
http://t.wits.sg/2008/06/23/howto-struts-2-i18n/ Did not success. (1) in package.properties label.code=example value (2) Put package.properties under /WEB-INF/classes/ (3) in jsp Still cannot see the result? -- Lu Ying ---

Re: getText did not return value in s:submit

2009-02-05 Thread Felipe Fraga
Pretty straight forward tutorial: http://t.wits.sg/2008/06/23/howto-struts-2-i18n/ Best regards, Felipe Fraga On Thu, Feb 5, 2009 at 5:29 PM, Emi Lu wrote: > Hi Dave, > >>> (3) but I do not know how jsp can recognize "package.properties"? >> >> You're mis-understanding how the text is retrieve

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
Hi Dave, (3) but I do not know how jsp can recognize "package.properties"? You're mis-understanding how the text is retrieved from the JSP: the JSP is calling the action's getText(...) method. Are you accessing the JSP directly, or through an action? I am new to struts2. I tried to use ge

Re: getText did not return value in s:submit

2009-02-05 Thread Dave Newton
Emi Lu wrote: I got why: I have to name the same property file name as the action class. Rename "package.properties" to ProcessInfo.properties, I got correct result. I just wonder isn't "package.properties" is recognized automatically? May I know how to use "package.properties" to display g

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
I got why: I have to name the same property file name as the action class. Rename "package.properties" to ProcessInfo.properties, I got correct result. I just wonder isn't "package.properties" is recognized automatically? May I know how to use "package.properties" to display getText() in jsp

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
Good morning, I got why: I have to name the same property file name as the action class. Rename "package.properties" to ProcessInfo.properties, I got correct result. I just wonder isn't "package.properties" is recognized automatically? May I know how to use "package.properties" to display ge

Re: getText did not return value in s:submit

2009-02-05 Thread Emi Lu
Hi Martin, Take a look at this example what is displayed when property is displayed in jsp? I got the same value displayed "edit.action" :( Do you know where I did wrong please? Thanks a lot! -- Lu Ying Date: Wed, 4 Feb 2009 16:50:43 -0500 From: em...@encs.concordia.ca To:

RE: getText did not return value in s:submit

2009-02-04 Thread Martin Gainty
Take a look at this example what is displayed when property is displayed in jsp? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a co

Re: getText issue from javascript

2007-11-28 Thread Dave Newton
First I'd try moving your JavaScript in to actual JavaScript methods and calling them from onclick to avoid any potentially weird escaping/quoting/etc. issues. That eliminates any parsing-oriented issues. d. --- Pablo Vázquez Blázquez <[EMAIL PROTECTED]> wrote: > Hello, > > Any idea about how t

Re: getText returning message key

2007-11-16 Thread Zarar Siddiqi
Make sure that you have a property called struts.custom.i18n.resources defined in struts.properties which refers to the resource bundles that you're using. For example: struts.custom.i18n.resources=resource1,resource2 The above would look for resource bundles called resource1.properties and reso