You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Yee <ry...@cruzio.com> on 2002/02/07 22:52:14 UTC
Accessing the ActionForm bean from within JSP page
Hi,
I'm trying to access a field in the actionForm bean from within
bean:message tag. Specifically, I want to use one of the attributes in the
bean as a value for the attr0 attribute in the bean:message tag. So far,
I've been able to use a scriptlet to set a page variable reference to the
ActionForm bean that is stored in session scope like this:
<% NewFormBean nfb = (NewFormBean) session.getAttribute("newFormBean"); %>
My ActionForm class is called NewFormBean and I have the following in my
struts-config.xml file:
<form-bean name="newFormBean"
type="dynaform.NewFormBean"/>
I'm wondering if there is a better way to access/expose this bean using the
struts tags? I've tried bean:struts and bean:page without much success. Can
someone tell me what the best way to do this is?
Thanks,
Richard
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>