ackage com.javabean;public class Police { public String name; public String getName() { System.out.println("now_Police_getName"); return name; } public void setName(String name) { this.name = name; }}user_define_javabean:<br>
<jsp:useBean id="police" class="com.javabean.Police"/>
<jsp:setProperty property="name" name="police" value="police"/>
jsp_getProperty:<jsp:getProperty property="name" name="police"/>那個(gè)javabean的屬性要為private,繼承Serializable,無參的構(gòu)造函數(shù)我都沒實(shí)現(xiàn),只設(shè)置了setter,getter就能跑起來,那不遵守規(guī)范有什么后果???javabean是類似于struts2那個(gè)配置好setter,getter,自動(dòng)給你生成對(duì)象一樣嗎????
javabean的標(biāo)準(zhǔn)???
守著星空守著你
2018-07-22 10:08:58