configure request param for action to be assigned to fields of bean

妖精的绣舞 提交于 2019-12-01 10:45:59

This is usual way to associate or aggregate a bean to the action class. The action class properties can be used directly by name that have property accessors. Nested beans properties are accessible via OGNL by specifying proper OGNL expression which is a path to the property. Assumed all properties accessors have not null references to beans. That could be achieved via providing corresponding getters and setters to properties and initializing bean references if necessary. So, bean.iSortColumn, bean.iDisplayTotalLength are valid OGNL expressions to set/get the bean properties. But you need to initialize it in the action. Like this

private Bean bean = new Bean();

public Bean getBean() { return bean; }

References:

  • To be familiar how OGNL works you can read in the OGNL Basics.
  • The base OGNL reference including a link to the OGNL language guide.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!