George World

技术改变明天,创新塑造未来! i(at)huadev.com Follow Me: http://t.sina.com.cn/georgeworld

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  28 随笔 :: 0 文章 :: 5 评论 :: 0 Trackbacks

如果在Struts2的Action中有一个变量: private String CCustomerInfo cCustomerInfo;

则使用MyEclipse生成的它的getter方法是:getCCustomerInfo()

生成的setter方法是:setCCustomerInfo(CCustomerInfo cCustomerInfo);

 

针对类似“aTestClass”这样的类变量,IDE生成的getter和setter无法与Struts2页面上的输入框name绑定,遇到这种情况,应该将“aTestClass”这样的类变量修改成“testClass”这样的变量名,然后在生成它的getter和setter,生成的getter和setter方法应该是:

getTestClass()、setTestClass(ATestClass testClass)

posted on 2010-10-23 13:41 George-tech 阅读(801) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: