[OT] Re: How do I access Message Resources in an Action?

2004-03-02 Thread Kris Schneider
If you want, post the JSTL question here (OT) or on taglibs-user...

Quoting [EMAIL PROTECTED]:

> J2SE 1.5 preview beta was released, and the site is getting hammered.  Which
> stinks because I need to see some APIs for a part of JSTL I'm not familiar
> with :-(
> 
> Rick DeBay
> 
> >- Original Message -
> >From: [EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]>
> >Sent: Tuesday, March 02, 2004 7:37 AM
> >Subject: How do I access Message Resources in an Action?
> >
> >
> >Hey everybody!
> >
> [snip]
> >
> >P.S.: Can you guys access http://java.sun.com http://java.sun.com>  ??!
> >Either my company's net is broken or the page is really down.
> >
> >___
> >Tim Adler, Abt. SDA1
> >Adress Management Solutions
> >AZ | Direct
> >Carl-Bertelsmann Straße 161s
> >D-33311 Gütersloh
> >
> >Tel.: 05241/ 80 - 89574
> >[EMAIL PROTECTED]

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

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



Re: How do I access Message Resources in an Action?

2004-03-02 Thread rick
J2SE 1.5 preview beta was released, and the site is getting hammered.  Which
stinks because I need to see some APIs for a part of JSTL I'm not familiar with :-(

Rick DeBay

>- Original Message -
>From: [EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]>
>Sent: Tuesday, March 02, 2004 7:37 AM
>Subject: How do I access Message Resources in an Action?
>
>
>Hey everybody!
>
[snip]
>
>P.S.: Can you guys access http://java.sun.com http://java.sun.com>  ??!
>Either my company's net is broken or the page is really down.
>
>___
>Tim Adler, Abt. SDA1
>Adress Management Solutions
>AZ | Direct
>Carl-Bertelsmann Straße 161s
>D-33311 Gütersloh
>
>Tel.: 05241/ 80 - 89574
>[EMAIL PROTECTED]



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



AW: How do I access Message Resources in an Action?

2004-03-02 Thread Tim . Adler
Thx everybody!

I found that Sateesh' advise worked quite well.
I added something like this here to my ActionServlet subclass

protected String getLocalizedMessage(String key,Locale l)
{
ResourceBundle rb =
PropertyResourceBundle.getBundle("resources.application",l);
Object value = rb.getObject(key);
debug("message-resource-lookup: KEY:"+key+" VALUE:"+value);

return value.toString();
}

-Ursprüngliche Nachricht-
Von: Adam Hardy [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 2. März 2004 14:04
An: Struts Users Mailing List
Betreff: Re: How do I access Message Resources in an Action?


I could send you off to look at the Javadoc, but sometimes working stuff 
out painstaking. Here's what I do:

MessageResources resources = (MessageResources)
 context.getAttribute(Globals.MESSAGES_KEY);
String msg = resources.getMessage("my.key");

Globals.MESSAGES_KEY is the default. If you set up other bundles, just 
change it appropriately. context is the page context - I took this from 
a taglib - you'd have to convert it to the servlet context I presume.

Adam

On 03/02/2004 01:37 PM [EMAIL PROTECTED] wrote:
> Hey everybody!
> 
> Well the subject basically states my problem already. I'd like to create a
> dynamical Navigation Bar that holds some pages you visited last. Therefore
> I'd like to add Name, Link and Parameters to a Collection for later
> printing. Problem is that the Name needs to come from the Message
Resources,
> and I don't know how to access those in an Action.
>  
> Can somebody help me?!
>  
> Thx!
>  
> P.S.: Can you guys access http://java.sun.com <http://java.sun.com>  ??!
> Either my company's net is broken or the page is really down.
> 
> ___
> Tim Adler, Abt. SDA1
> Adress Management Solutions
> AZ | Direct
> Carl-Bertelsmann Straße 161s
> D-33311 Gütersloh
> 
> Tel.: 05241/ 80 - 89574
> [EMAIL PROTECTED] 
> 
>  
> 


-- 
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian


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

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



Re: How do I access Message Resources in an Action?

2004-03-02 Thread Adam Hardy
I could send you off to look at the Javadoc, but sometimes working stuff 
out painstaking. Here's what I do:

MessageResources resources = (MessageResources)
context.getAttribute(Globals.MESSAGES_KEY);
String msg = resources.getMessage("my.key");
Globals.MESSAGES_KEY is the default. If you set up other bundles, just 
change it appropriately. context is the page context - I took this from 
a taglib - you'd have to convert it to the servlet context I presume.

Adam

On 03/02/2004 01:37 PM [EMAIL PROTECTED] wrote:
Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com   ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh
Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED] 

 



--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: How do I access Message Resources in an Action?

2004-03-02 Thread Kommineni, Sateesh \(GE Consumer & Industrial\)
Hi,

  User PropertyResourceBundle ..
  
  PropertyResourceBundle propBundle = null;
try{
  propBundle = (PropertyResourceBundle)PropertyResourceBundle.getBundle(resFileName);  
 
}

-Sateesh

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 6:07 PM
To: [EMAIL PROTECTED]
Subject: How do I access Message Resources in an Action?


Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com <http://java.sun.com>  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED] 

 

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



Re: How do I access Message Resources in an Action?

2004-03-02 Thread James Mitchell
The same way it is done in the struts-example.  Did you run that yet?


--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
MSN: [EMAIL PROTECTED]



- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 7:37 AM
Subject: How do I access Message Resources in an Action?


Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.

Can somebody help me?!

Thx!

P.S.: Can you guys access http://java.sun.com <http://java.sun.com>  ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED]






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



How do I access Message Resources in an Action?

2004-03-02 Thread Tim . Adler
Hey everybody!

Well the subject basically states my problem already. I'd like to create a
dynamical Navigation Bar that holds some pages you visited last. Therefore
I'd like to add Name, Link and Parameters to a Collection for later
printing. Problem is that the Name needs to come from the Message Resources,
and I don't know how to access those in an Action.
 
Can somebody help me?!
 
Thx!
 
P.S.: Can you guys access http://java.sun.com   ??!
Either my company's net is broken or the page is really down.

___
Tim Adler, Abt. SDA1
Adress Management Solutions
AZ | Direct
Carl-Bertelsmann Straße 161s
D-33311 Gütersloh

Tel.: 05241/ 80 - 89574
[EMAIL PROTECTED]