<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/>给一个对象的属性动态赋值
<jsp:setProperty name="order" property="totalPrice" value="?"/>我要给totalPrice属性动态赋值,应该怎么实现啊!
jsp:useBean 标签对应的类, setProperty 的属性必须与其一致。
<%
String aaa="bbbb";
%>
<jsp:setProperty name="order" property="totalPrice" value="<%=aaa%>"/>