diapatcher.forward(request,response),在轉到的jsp頁面中,用<jsp:useBean id="account" type="bean.Account" scope="request" > <jsp:getProperty name="account" property="name" /></jsp:useBean>無法獲得這個account。用<% bean.Account a = (bean.Account)request.getAttribute("account"); out.print(a.getName());%>卻可以獲得這個屬性,為什么?
1 回答

暮色呼如
TA貢獻1853條經驗 獲得超9個贊
get/setAttribute指的是容器中的某個變量,而<jsp:getProperty是去http的參數請求,所以無法得到,因為你已經重定向了,getParamter方法取不到,jsp:getProperty自然取不到,你可以用setParamter方法設置后再?。?/p>
- 1 回答
- 0 關注
- 83 瀏覽
添加回答
舉報
0/150
提交
取消