struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Gin" <>
Subject RE: Accessing the ActionForm object from within JSP
Date Wed, 09 Jul 2003 18:35:41 GMT
I gave this on the Struts irc channel once:

<c:set var="currentFormName"
Then access the form using the name.
<c:out value="${request.attribute[currentFormName].blah}" />

Hope that works for you.
I think someone had a shorter solution for it (combine it into one c:out?)
but you can probably figure that one out based on this.

-----Original Message-----
From: Larson, Kirk []
Sent: Wednesday, July 09, 2003 2:04 PM
To: ''
Subject: Accessing the ActionForm object from within JSP

I want to access a form within my JSP page using JSTL.  I have it working by
simply specifying the name of the form (cycleDateForm) in the JSTL EL.
However, this does not seem like the correct method of solving this problem.
The form name is derived from the Struts configuration file using the
appropriate action mapping.  Since the JSP page only specifies the action
name and does not directly specify the form name, it does not seem that it
should reference the form directly. However, I am not sure how to determine
the name of the form object?  Any suggestions?

Sample JSP page :
<html:form action="/cycledates/edit" >
	<c:forEach items="${cycleDateForm.cycleDates}" var="cycleDate">
		<c:out value="${cycleDate.key}"/><br>

Relevant portion of struts-config.xml :
	<form-bean name="cycleDateForm"
type="" />
			<forward name="success" path="cycledates.edit.frame"
redirect="false" />


This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message