About EL
I run a example about EL in chapter 5 of <<Beginning JSP>> .
The code is following:
index.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<html>
<head>
<title>EL Implicit Object Example</title>
</head>
<body>
<h1>EL Implicit Object Example</h1>
<form action="formproc.jsp" method="post">
<table>
<tr>
<td colspan="2">Design a cake</td>
</tr>
<tr>
<td>cake shape:</td>
<td>
<select name="shape">
<option>round</option>
<option>square</option>
<option>heart</option>
</select>
</td>
</tr>
<tr>
<td>Toppings:</td>
<td>
<input type="checkbox" name="topping" value="choc">Chocolate</input>
<input type="checkbox" name="topping" value="cane">Candy Cane</input>
<input type="checkbox" name="topping" value="flower">Flower</input>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Send">
</td>
</tr>
</table>
</form>
</body>
</html>
formproc.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<html>
<body>
shape of cake selected:${param.shape}
<br>toppings selected:
<c:forEach var="aTopping" items="${paramValues.topping}">
${aTopping}
</c:forEach>
</br>
<br>browser:${header["user-agent"]}</br>
<br>
<a href="ch05.jsp">back to form</a>
</br>
</body>
</html>
After executing,Some EL don't correctly be showed,for example:${param.shape}¡¢${aTopping}¡¢${header["user-agent"]}.These El don't be executed,bu they are be showed as a string in html.And it doesn't write any error information in IE.But other El in JSTL is right.
Who could tell me why?thanks vary much!
|