Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TBD - talk about how to do ajax once Seth figures it out

Below, SafoForm is the ActionForm associated with the Action that launches this JSP and co is an instance variable within SafoForm. Struts translates SafoForm.co into a call to the method getCo() within SafoForm.

cumulativeReport.header.coDesc is an example of how to access a business object that has been set as an attribute, cumulativeReport, within the request. See the section on Actions for an example of setting the request attribute with a business object.

Notice that Struts is able to deal with returning nested objects. The business object represented by cumulativeReport has another business object, Header, represented as the instance variable header. Within the business object Header, there is an instance variable coDesc. Struts translates cumulativeReport.header.coDesc into CumulativeReport.getHeader().getCoDesc().

See the Apache Struts Taglib Developer Guides for more about using the nested syntax.  Image Added