I am not trying to trap an error message.  What I want to do is instead of
having multiple pages showing the status message to the users, I would have
one generic page, and have the action servlet send the message resouce key
and hopefully bean:message can dynamically pull a message out of the
resource file.

So instead of doing <bean:message key="foo"> I would like the key to be
dynamic so you see different message depending on what's sent back by the
action servlet, hopefully via something like this:

<bean:message key="<%= request.getAttribute("status")%>" />

but so far I haven't found a way that will compile and achieve that.

- boon

-----Original Message-----
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 2:40 PM
To: 'Struts Users Mailing List'
Subject: RE: dynamic bean message


What error messages are you trapping?  Try escaping the quotation market in
the expression.

Mark

-----Original Message-----
From: Boon Chew [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 5:38 PM
To: [EMAIL PROTECTED]
Subject: dynamic bean message



I searched on the archive and didn't find an question similar to this...

What I am trying to achieve is when the action servlet is done its job it
would forward to a
generic JSP page that will show the appropriate message to the user.

For example, at the end of the action servlet,

// save the message resource key
request.setAttribute("status", "status.success");
return (mapping.findForward("message"));

And in message.jsp, I tried doing this in hope of display different message
depending on what is being set in the status attribute.

<bean:message key="<%= request.getAttribute("status") %>" />

The above line won't work.  It seems like doing a JSP expression within a
tag is not allowed...is there another way or a better way to achieve this?

- boon


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


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

Reply via email to