jstl标签库里<set>的一个问题 20
运行结果name值能显示,但是age值设置不进去!int和integer都不行!<%Set_beanbean=newSet_bean();request.setAttri...
运行结果
name值能显示,但是age值设置不进去!int 和integer都不行!
<%
Set_bean bean=new Set_bean();
request.setAttribute("bean", bean);
%>
<c:set var="v2" value="222222" target="${bean}" property="name"/>
<c:set var="v1" target="${bean}" property="age">10</c:set>
${bean.name}
${bean.age}
————
package bean;
public class Set_bean {
//private int age;
private Integer age;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
} 展开
name值能显示,但是age值设置不进去!int 和integer都不行!
<%
Set_bean bean=new Set_bean();
request.setAttribute("bean", bean);
%>
<c:set var="v2" value="222222" target="${bean}" property="name"/>
<c:set var="v1" target="${bean}" property="age">10</c:set>
${bean.name}
${bean.age}
————
package bean;
public class Set_bean {
//private int age;
private Integer age;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询