Custom Mapping Class

2001-01-05 Thread John Hunt

Thanks for the reply Craig


Could some one tell me  -
When would one want to use a custom ActionMapping
class? The example given in bluestone.com doesnt
convince me.

Thanks
Hunt


--- "Craig R. McClanahan"
<[EMAIL PROTECTED]> wrote:
> John Hunt wrote:
> 
> > 1. Action class provides getResources() which
> return
> > MessageResources. Is the MessageResource always
> the
> > one specified in web.xml ( say
> > ApplicationResources.Properties ) or is it based
> on
> > the locale set + the one specified in web.xml (
> and
> > thus for locale xx it is
> > ApplicationResources_XX.Properties )
> 
> Yah, this can be a little confusing.
> 
> In web.xml, you configure the location of your
> message resources (using the
> default MessageResources implementation, this is a
> name that looks like a Java
> class name -- the example app uses
> "org.apache.struts.example.ApplicationResources").
> 
> Although there is only one MessageResources
> instance, it is initialized from
> *all* of the properties files that have the base
> name you've identified.  The
> first time you ask for a message with a new locale,
> the corresponding properties
> file is loaded if necessary, transparent to you.
> 
> >
> > 2. In all the *Action.java files in example
> directory
> > of struts, I see explicit calls being made to
> > getLocale() and getResources() but the values
> returned
> > arent being used anywhere else in the program. Is
> it
> > always mandatory for us to explicitly call
> getLocale
> > and getResources in our action classes?
> >
> 
> No, you can chalk that up to a little bit of
> over-aggressive cut and paste :-).
> 
> You need only call these getters if you need to use
> the results.
> 
> >
> > Thanks for any advice
> >
> > Hunt
> >
> 
> Craig McClanahan
> 
> 


__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/



Custom Mapping Class

2001-01-05 Thread John Hunt

Let me add some more:
If some Action classes want some parameters which
could be fed by custom ActionMapping class, making
ActionServlet to use that custom ActionMapping class
for all occurrances ( by making it an init parameter )
 is  I dont know...

--- John Hunt <[EMAIL PROTECTED]> wrote:
> Thanks for the reply Craig
> 
> 
> Could some one tell me  -
> When would one want to use a custom ActionMapping
> class? The example given in bluestone.com doesnt
> convince me.
> 
> Thanks
> Hunt
> 
> 
> --- "Craig R. McClanahan"
> <[EMAIL PROTECTED]> wrote:
> > John Hunt wrote:
> > 
> > > 1. Action class provides getResources() which
> > return
> > > MessageResources. Is the MessageResource always
> > the
> > > one specified in web.xml ( say
> > > ApplicationResources.Properties ) or is it based
> > on
> > > the locale set + the one specified in web.xml (
> > and
> > > thus for locale xx it is
> > > ApplicationResources_XX.Properties )
> > 
> > Yah, this can be a little confusing.
> > 
> > In web.xml, you configure the location of your
> > message resources (using the
> > default MessageResources implementation, this is a
> > name that looks like a Java
> > class name -- the example app uses
> > "org.apache.struts.example.ApplicationResources").
> > 
> > Although there is only one MessageResources
> > instance, it is initialized from
> > *all* of the properties files that have the base
> > name you've identified.  The
> > first time you ask for a message with a new
> locale,
> > the corresponding properties
> > file is loaded if necessary, transparent to you.
> > 
> > >
> > > 2. In all the *Action.java files in example
> > directory
> > > of struts, I see explicit calls being made to
> > > getLocale() and getResources() but the values
> > returned
> > > arent being used anywhere else in the program.
> Is
> > it
> > > always mandatory for us to explicitly call
> > getLocale
> > > and getResources in our action classes?
> > >
> > 
> > No, you can chalk that up to a little bit of
> > over-aggressive cut and paste :-).
> > 
> > You need only call these getters if you need to
> use
> > the results.
> > 
> > >
> > > Thanks for any advice
> > >
> > > Hunt
> > >
> > 
> > Craig McClanahan
> > 
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/


__
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/