I am a Solivagant
Lofter    Posts     新文章     文章管理     新日记     日记管理

[Struts2] <s:property>标签

调用类中的属性,通过get方法调用,而非其属性名调用.

比如A类中有属性a1,a1的get方法是getA1Method();

相应Action类中的get方法是getA1Action().

那么需要通过:

<s:property value="a1Method" />不能调用,

而是a1Action才能调用get方法.

property中的value映射的是Action中的get方法.

这个Action必须是struts.xml配置文件中跳转该网页的result对应的<action>标签中的class attribute指定的Action.

posted @ 2018-06-21 11:06  宛如ZZ  阅读(941)  评论(0编辑  收藏  举报