aspose file tools*
The moose likes Struts and the fly likes Struts 1: Problem using EL to reference form bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1: Problem using EL to reference form bean" Watch "Struts 1: Problem using EL to reference form bean" New topic
Author

Struts 1: Problem using EL to reference form bean

Steve J Holmes
Greenhorn

Joined: Feb 08, 2008
Posts: 4
I am using struts 1.3.8 and JSTL 1.1

EL is working ok (I can access vars in all scopes).

I have a DynaValidatorActionForm in session scope which EL can see, but when I try to access a property using ${myForm.flowType} (flowType is a string declared in struts-config.xml) I get:

javax.servlet.jsp.el.ELException: Cannot find PropertyDescriptor for 'flowType' for bean 'class org.apache.struts.validator.DynaValidatorActionForm'

Thanks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The Struts DynaActionForm uses a Map to store property names and values. The Struts bean:write tag knows this and allows for it, but JSTL tags are not aware of this. Therefore, when using JSTL, you must reference the map that holds the variables through a property called "map". Example:


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1: Problem using EL to reference form bean