Re: How to read MessageResources.

2004-10-14 Thread Alan Pocklington
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.

Re: How to read MessageResources.

2004-10-13 Thread Bill Siggelkow
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

Re: How to read MessageResources.

2004-10-13 Thread Justy
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

Re: How to read MessageResources.

2004-10-13 Thread Alan Pocklington
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

Re: How to read MessageResources.

2004-10-13 Thread Hubert Rabago
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

Re: How to read MessageResources.

2004-10-13 Thread Hubert Rabago
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

Re: How to read MessageResources.

2004-10-13 Thread Alan Pocklington
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

Re: How to read MessageResources.

2004-10-13 Thread Hubert Rabago
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

Re: How to read MessageResources.

2004-10-13 Thread Alan Pocklington
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

Re: How to read MessageResources.

2004-10-13 Thread Hubert Rabago
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

Re: How to read MessageResources.

2004-10-13 Thread Alan Pocklington
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

Re: How to read MessageResources.

2004-10-13 Thread Hubert Rabago
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

How to read MessageResources.

2004-10-13 Thread Alan Pocklington
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, -