I am using struts 1.0.2, so there are no ActionMessages.

I tried your example #1 (with a slight modification to get it to run)
userInfo =
((MessageResources)request.
                getAttribute(Action.MESSAGES_KEY)).
                getMessage("user.info.message");

and it has the same behavior as before.

the second example will not work since i am in a jsp.

thanks,
mark


-----Original Message-----
From: Taylor, Jason [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 11:44 AM
To: 'Struts Users Mailing List'
Subject: RE: message code not working 


According to source code, the attribute in the distribution I use is
"org.apache.struts.action.ACTION_MESSAGE", though it seems a bit odd to use
the syntax you're using.  

Why not do 
        userInfo =
((MessageResources)request.getAttribute(Action.MESSAGE_KEY).getMessage("user
.info.message");

to reap the benefits of encapsulation and compile-time checking of your
attribute name or 
        userInfo = getResources(request).getMessage("user.info.message");

if you happen to be within an Action class already?

-----Original Message-----
From: Mark Silva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 11:28 AM
To: Struts Users Mailing List
Subject: message code not working 


can anyone tell me what is wrong with this code in my jsp?  other than the
fact that i am not using a tag ;-)

userInfo =
((MessageResources)request.getAttribute("org.apache.struts.action.MESSAGE"))
.getMessage("user.info.message");

my jsp is not loading properly.  the text gets cut off some somewhere in the
page, making me think that this statement is sending some strange
chanracters along....

thanks,
mark

--
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]>

Reply via email to