RE: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Soomar, Muki (R.)

Seems to me that it was a wrong decision to deprecate this method
not thinking that ActionForm might also require access to the resources.

Cant figure out how else I would get access to it if needed to do 
checking, and may just have to assume <> that it will be
available for use. 

I have spent enough time researching this and calling quits -- unlsess the
GURUS
come forward and show an example... :)


Muki Soomar


-Original Message-
From: Barbara Post [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 1:12 PM
To: Struts Users Mailing List
Subject: Re: ActionServlet.getResources() Method alternative ??


Have almost found the answer but am stuck on a newbie problem because
MessageResourcesFactory is an abstract class.

In my ActionForm :

   ApplicationConfig applicationConf = new
ApplicationConfig("",this.getServlet());
String msgResourcesParameter =
applicationConf.findMessageResourcesConfig("mypackage.ApplicationResources")
.getParameter();

Now I have to call :
createResources(msgResourcesParameter)

This method of MessageResourcesFactory returns a MessageResources.

Well, soon we will have the answer. Can anyone help ? What a shame LOL.

Barbara



 

__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Barbara Post

Have almost found the answer but am stuck on a newbie problem because
MessageResourcesFactory is an abstract class.

In my ActionForm :

   ApplicationConfig applicationConf = new
ApplicationConfig("",this.getServlet());
String msgResourcesParameter =
applicationConf.findMessageResourcesConfig("mypackage.ApplicationResources")
.getParameter();

Now I have to call :
createResources(msgResourcesParameter)

This method of MessageResourcesFactory returns a MessageResources.

Well, soon we will have the answer. Can anyone help ? What a shame LOL.

Barbara



 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Barbara Post

Well, I think ApplicationConfig is the direction to look to...


- Original Message - 

 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Soomar, Muki (R.)

Barb,
I should have pointed out.. I had tried that already and got the same result :) ..
But what Emanuel was suggesting would work if evey message in the
Message Resources would be stored at the context level. Then we would
be able to retrieve it as follows:
String message = 
(String)servlet.getSevletContext().getAttribute("message_key");
but I dont think that is true.

I am still researching it.. so would let you know as well. 

Thanks.



Muki Soomar
Solutions Architect
Consumer Facing Practice
Global Consumer Systems
4S-110, Regent Court
Phone: (313) 20-64687
Ford Motor Co.


-Original Message-
From: Barbara Post [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 11:34 AM
To: Struts Users Mailing List
Subject: Re: ActionServlet.getResources() Method alternative ??


Hello Muki, I am right now struggling with it.

If I do as the other guy proposed, I get a NullPointer...
He told : (MessageResources)
this.getServlet().getServletContext().getAttribute(Action.MESSAGE_KEY);

Will tell you whether I find the solution first ;-)
I have few hours left to find it, anyway...

- Original Message -
From: Soomar, Muki (R.) <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 5:30 PM
Subject: RE: ActionServlet.getResources() Method alternative ??


>
> I am trying to check if I have access to the Message Resources in my
ActionForm subclass before I
> use the error messages that are available in the Message resource
bundle.
>
> So earlier I was using:
> MessageResources errorMessages = servlet.getResources();
> to get the resource object.
>
> Then I check if this object is not null and also try to retrieve a
message for a key.. e.g
> servlet.log ( errorMessages.getMessage("form.name.required");
>
>This will log into my log file and confirm that, yes indeed I have
access to all my message resources.
>
> However, now the above method on the ActionServlet is deprecated. The
ActionSevlet object was
>availble to me inside the ActionForm object.
>
>  My dilemma is what other methods are available to me now to retrieve
the MessageResources object
>
> << Barbara wrote:
> MessageResources getResources()
>   Deprecated. Actions should call
> Action.getResources(HttpServletRequest) instead of this method, in order
to
> retrieve the resources for the current sub-application
> >>
>
> The above is only applicable from my Action subclass not my ActionForm
subclass.
> I was just trying to ensure that I would have access to my
MessageResources before
> I use it in my ActionForm subclass...
>
> Any more suggestions how I could do this.. ???
>
> Thanks.
>
> Muki Soomar


 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Barbara Post

Hello Muki, I am right now struggling with it.

If I do as the other guy proposed, I get a NullPointer...
He told : (MessageResources)
this.getServlet().getServletContext().getAttribute(Action.MESSAGE_KEY);

Will tell you whether I find the solution first ;-)
I have few hours left to find it, anyway...

- Original Message -
From: Soomar, Muki (R.) <[EMAIL PROTECTED]>
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 5:30 PM
Subject: RE: ActionServlet.getResources() Method alternative ??


>
> I am trying to check if I have access to the Message Resources in my
ActionForm subclass before I
> use the error messages that are available in the Message resource
bundle.
>
> So earlier I was using:
> MessageResources errorMessages = servlet.getResources();
> to get the resource object.
>
> Then I check if this object is not null and also try to retrieve a
message for a key.. e.g
> servlet.log ( errorMessages.getMessage("form.name.required");
>
>This will log into my log file and confirm that, yes indeed I have
access to all my message resources.
>
> However, now the above method on the ActionServlet is deprecated. The
ActionSevlet object was
>availble to me inside the ActionForm object.
>
>  My dilemma is what other methods are available to me now to retrieve
the MessageResources object
>
> << Barbara wrote:
> MessageResources getResources()
>   Deprecated. Actions should call
> Action.getResources(HttpServletRequest) instead of this method, in order
to
> retrieve the resources for the current sub-application
> >>
>
> The above is only applicable from my Action subclass not my ActionForm
subclass.
> I was just trying to ensure that I would have access to my
MessageResources before
> I use it in my ActionForm subclass...
>
> Any more suggestions how I could do this.. ???
>
> Thanks.
>
> Muki Soomar


 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Soomar, Muki (R.)


I am trying to check if I have access to the Message Resources in my ActionForm 
subclass before I 
use the error messages that are available in the Message resource bundle.

So earlier I was using:
MessageResources errorMessages = servlet.getResources();   
to get the resource object.
   
Then I check if this object is not null and also try to retrieve a message for a 
key.. e.g
servlet.log ( errorMessages.getMessage("form.name.required");

   This will log into my log file and confirm that, yes indeed I have access to all my 
message resources.

However, now the above method on the ActionServlet is deprecated. The ActionSevlet 
object was
   availble to me inside the ActionForm object.

 My dilemma is what other methods are available to me now to retrieve the 
MessageResources object

<< Barbara wrote:
MessageResources getResources()
Deprecated. Actions should call
Action.getResources(HttpServletRequest) instead of this method, in 
order to
retrieve the resources for the current sub-application
>>

The above is only applicable from my Action subclass not my ActionForm subclass.
I was just trying to ensure that I would have access to my MessageResources before
I use it in my ActionForm subclass...

Any more suggestions how I could do this.. ???

Thanks.

Muki Soomar


-Original Message-
From: Barbara Post [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 10:45 AM
To: Struts Users Mailing List
Subject: Re: ActionServlet.getResources() Method alternative ??


just pass to it the request parameter, i.e :

MessageResources getResources()
  Deprecated. Actions should call
Action.getResources(HttpServletRequest) instead of this method, in order to
retrieve the resources for the current sub-application


- Original Message -
From: Soomar, Muki (R.) <[EMAIL PROTECTED]>
To: Struts-User (E-mail) <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 4:26 PM
Subject: ActionServlet.getResources() Method alternative ??


> Can anyone tell me how I can access the Message Resources from an
ActionForm
> sub-class, now that the ActionServlet.getResouces() method is deprecated.
>
> Thanks.
>
> Muki Soomar
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>

 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Barbara Post

ah thanks, this helps me too, since I was looking for it, in fact...
:-/
- Original Message -
From: emmanuel.boudrant <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 4:46 PM
Subject: Re: ActionServlet.getResources() Method alternative ??


>
> I use
> getServlet().getServletContext().getAttribute(Action.MESSAGE_KEY);
>  -Emmanuel
>   "Soomar, Muki (R.)" <[EMAIL PROTECTED]> a écrit : Can anyone tell me how
I can access the Message Resources from an ActionForm
> sub-class, now that the ActionServlet.getResouces() method is deprecated.
>
> Thanks.
>
> Muki Soomar
>
>
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:
>
>
>
> -
> Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !
>

 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread emmanuel.boudrant


I use 
getServlet().getServletContext().getAttribute(Action.MESSAGE_KEY);
 -Emmanuel
  "Soomar, Muki (R.)" <[EMAIL PROTECTED]> a écrit : Can anyone tell me how I can access 
the Message Resources from an ActionForm
sub-class, now that the ActionServlet.getResouces() method is deprecated. 

Thanks.

Muki Soomar


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



-
Yahoo! Mail -- Une adresse @yahoo.fr gratuite et en français !



Re: ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Barbara Post

just pass to it the request parameter, i.e :

MessageResources getResources()
  Deprecated. Actions should call
Action.getResources(HttpServletRequest) instead of this method, in order to
retrieve the resources for the current sub-application


- Original Message -
From: Soomar, Muki (R.) <[EMAIL PROTECTED]>
To: Struts-User (E-mail) <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 4:26 PM
Subject: ActionServlet.getResources() Method alternative ??


> Can anyone tell me how I can access the Message Resources from an
ActionForm
> sub-class, now that the ActionServlet.getResouces() method is deprecated.
>
> Thanks.
>
> Muki Soomar
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>

 
__
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




ActionServlet.getResources() Method alternative ??

2002-06-14 Thread Soomar, Muki (R.)

Can anyone tell me how I can access the Message Resources from an ActionForm
sub-class, now that the ActionServlet.getResouces() method is deprecated. 

Thanks.

Muki Soomar


--
To unsubscribe, e-mail:   
For additional commands, e-mail: