<form action=”TestBean.jsp”>
Name: <input type=”text” name=”name”>
ID#: <input type=”text” name=”empID”>
First food: <input type=”text” name=”food”>
Second food: <input type=”text” name=”food”>
<input type=”submit”>
</form>
在jsp中我试图这样做
First food request param: ${param.food[0]} <br>
Second food request param: ${param.food[1]} <br>
当我尝试运行它时,我收到此错误
javax.el.PropertyNotFoundException: Property '0' not found on type java.lang.String
答案 0 :(得分:0)
我正在尝试
First food request param: ${param.food[0]} <br>
Second food request param: ${param.food[1]} <br>
而不是
First food request param: ${paramValues.food[0]} <br>
Second food request param: ${paramValues.food[1]} <br>
将param.food [0]更改为paramValues.food [0]解决了这个问题。