Bill,
Thanks for the pointer. I have already downloaded the source and have
extended Struts successfully many times. The MessageResources thing was
something I couldn't quite get my head around, so I figured I'd ask the
experts. Now I have the code, it didn't seem so complicated after all.
Alan -- I strongly encourage you (if you haven't already) to download
the Struts source and use it as you develop. You will be amazed at how
much quicker you can grok Struts.
-Bill Siggelkow
Alan Pocklington wrote:
Oh okay, I'll look into that. Thanks for your help.
Hubert Rabago <[EMAIL PROT
getLocale(::HttpServletRequest) will get locale from session instead of request.
On Wed, 13 Oct 2004 15:54:02 + (UTC), Alan Pocklington
<[EMAIL PROTECTED]> wrote:
> Cheers for pointing that out. As of yet I don't need message arguments
> so that'll be fine.
>
> Was there any reason for havi
Oh okay, I'll look into that. Thanks for your help.
Hubert Rabago <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Struts has some special treatment for locales. You'd wanna abide by
> that for consistency with what its internal engine uses for the
> resource files.
>
>
> On Wed, 13 Oc
Struts has some special treatment for locales. You'd wanna abide by
that for consistency with what its internal engine uses for the
resource files.
On Wed, 13 Oct 2004 15:54:02 + (UTC), Alan Pocklington
<[EMAIL PROTECTED]> wrote:
> Cheers for pointing that out. As of yet I don't need messag
Yup, right here:
/**
* Get the locale that will be used for a conversion operation.
*/
protected Locale getLocale(HttpServletRequest request) {
Locale locale = null;
// see if there's a locale present among the session attributes
HttpSession session = req
Cheers for pointing that out. As of yet I don't need message arguments
so that'll be fine.
Was there any reason for having a getLocale(request) method? I'm guessing
the implementation was different from just request.getLocale().
Hubert Rabago <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED
On Wed, 13 Oct 2004 10:38:09 -0500, Hubert Rabago <[EMAIL PROTECTED]> wrote:
> Yup, copy/paste from existing code works fast. :)
It's also not foolproof. This excerpt was specific to the needs of
the class I took it from. Check the getMessage() method -- it can
actually accept message arguments
In that case, do you have the existing code for the method
getLocale(request)? I haven't got my head around locales yet.
Hubert Rabago <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Yup, copy/paste from existing code works fast. :)
>
>
> On Wed, 13 Oct 2004 15:35:24 + (UTC), Al
Yup, copy/paste from existing code works fast. :)
On Wed, 13 Oct 2004 15:35:24 + (UTC), Alan Pocklington
<[EMAIL PROTECTED]> wrote:
> Wow, thanks for the quick reply. Will do!
>
> Hubert Rabago <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
>
>
> > Put this in a util class and
Wow, thanks for the quick reply. Will do!
Hubert Rabago <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Put this in a util class and call evaluateMessage():
>
> /**
> * Evaluate the given message resource key.
> *
> * @param messageKey the name of the resource entry t
Put this in a util class and call evaluateMessage():
/**
* Evaluate the given message resource key.
*
* @param messageKey the name of the resource entry to retrieve
* @param bundle The key specified in the
* element for the
* resource bundle
Hi,
I want my action to read a property from the MessageResources.properties
file in the same way that ActionMessages does. What's the simplest code I
can use to retreive a particular property's value?
Thanks in advance,
-
13 matches
Mail list logo