Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1: Problem using EL to reference form bean

 
Steve J Holmes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic