<form action="<%=request.getContextPath() %>/ch01/showOrder.jsp" name="myform" method="post">
<input name="code" type="text">
<input name="cellphone" type="text">
<textarea name="lang" cols="15" rows="2"></textarea>
<input type="submit" value="请确认以上信息无误,提交" />
</form>
在showOrder.jsp页面进行接收赋值给order对象
<jsp:useBean id="order" class="ch01.Order" scope="session"/>
<jsp:setProperty name="order" property="code" param="code"/>
<jsp:setProperty name="order" property="cellphone" param="telephone"/>
<jsp:setProperty name="order" property="Notice" param="lang"/>我在调试的时候红色部分报错,前面两个都能接受并赋值。
错误:Cannot find any information on property 'Notice' in a bean of type 'ch01.Order'
在Order累中存在变量Notice,
能不能通过JSP的标准动作<jsp:setProperty/>给一个对象的属性动态赋值
<input name="code" type="text">
<input name="cellphone" type="text">
<textarea name="lang" cols="15" rows="2"></textarea>
<input type="submit" value="请确认以上信息无误,提交" />
</form>
在showOrder.jsp页面进行接收赋值给order对象
<jsp:useBean id="order" class="ch01.Order" scope="session"/>
<jsp:setProperty name="order" property="code" param="code"/>
<jsp:setProperty name="order" property="cellphone" param="telephone"/>
<jsp:setProperty name="order" property="Notice" param="lang"/>我在调试的时候红色部分报错,前面两个都能接受并赋值。
错误:Cannot find any information on property 'Notice' in a bean of type 'ch01.Order'
在Order累中存在变量Notice,
能不能通过JSP的标准动作<jsp:setProperty/>给一个对象的属性动态赋值
解决方案 »
- 在java中(SSH)有个表有主键ID(varchar) 类别(varchar) 父类ID(varchar)都放到List怎么冒泡排序或其他方法
- jquery 与struts2中的标签为何不能这样使用?
- 如何解决log4g保存的路径?
- 获取字符数?
- struts2 中通过pojo映射form出现空值
- action中得到一个String,String内容是一个html页面的源码,把这个String要显示到jsp页面中去?
- 怎么在不同的机器之间进行通信呢,传数据???`
- 怎么分子模块配置多个struts-config文件?
- java与xml编程问题
- hibernate JPA传递list和array参数的问题
- hibernate多表查询求相应的HQL语句
- spring c3p0数据库连接池问题,现在所有的分都送上
<jsp:setProperty name="order" property="totalPrice" value="?"/>我要给totalPrice属性动态赋值,应该怎么实现啊!
jsp:useBean 标签对应的类, setProperty 的属性必须与其一致。
<%
String aaa="bbbb";
%>
<jsp:setProperty name="order" property="totalPrice" value="<%=aaa%>"/>