Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助~关于struts的formbean的疑惑
marcos





发贴: 5
积分: 0
于 2006-07-13 14:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
formbean的get和set方法后的第一个字母为什么要大写阿~

private String message = "";
  
  public void setMessage(String newMessage)//这里的set后面字母大写
  {
    this.message = newMessage;
  }

  public String getMessage()//这里的get后面字母大写
  {
    return this.message;
  }

我用javabean测试了下不用大写有编译错误,但我在struts的frombean没有大写却没错阿~不解
struts里面我这样写的
private String message = "";
  
  public void setmessage(String newMessage)//这里的set后面字母大写
  {
    this.message = newMessage;
  }

  public String getmessage()//这里的get后面字母大写
  {
    return this.message;
  }
然后再jsp文件里面

。。。。。。。。。。
<TR>
<TH align="right"><bean:message key="edit.jsp.messages"/></TH>
<TD align="left"><html:text property="message"/></TD>
</TR>
。。。。。。。
这样用的~
,求解阿~~



作者 Re:求助~关于struts的formbean的疑惑 [Re:marcos]
bluepure

pureblue



发贴: 509
积分: 85
于 2006-07-13 16:40 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
这个是javaBean规范里定义了的。

formBean也是javaBean.



作者 Re:求助~关于struts的formbean的疑惑 [Re:marcos]
wnpss





发贴: 4
积分: 0
于 2008-02-08 16:42 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
你真有意思啊!
javabean 源文件就装吗规定的啊,挺逗人的




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923