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
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
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
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}
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
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
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
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
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
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
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
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
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
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,
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
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:
; > 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
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
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
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
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
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
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
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
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
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
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: &
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.
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
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
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
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
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)
>
>
>> (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.
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
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
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
---
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
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
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
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
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
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:
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
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
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
46 matches
Mail list logo