File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes bean:message and bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:message and bean:write" Watch "bean:message and bean:write" New topic

bean:message and bean:write

Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
I'm trying to output a message from while passing in an arg. The value I want to pass as an arg is in the FormBean. However, I cannot pass a variable to the message tag without using scriptlets. What is a good way to do this?

How to I pass a vatiable into bean:message?
[ November 02, 2006: Message edited by: Chris Novindus ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Use the Struts-el version of the tags. Then you can substitute an EL expression.

To use the Struts-el version, use the following taglib definition:

<%@ taglib uri="" prefix="bean" %>

and make sure you have struts-el.jar, jstl.jar, and standard.jar in your classpath.

Then you can write:

Where myForm is the name of your ActionForm.
[ November 03, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: bean:message and bean:write
It's not a secret anymore!