一JSP新手的弱问题

apacheshine 2004-06-08 03:24:14
TOM CAT 5
下边编写了一个JSP文件,该例子来自与JSP权威人士之一的O'REILLY的JSP。但是跑不起来,提示的意思大概是说TAG不允许表达式。后来我又冲下下载了JSTL,还是不行,请哪位大侠给看看先
例子如下

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>User Info Entry Form</title>
</head>
<body bgcolor="white">
<form action="input_jstl.jsp" method="post">
<table>
<tr>
<td>Name:</td>
<td>
<input type="text" name="userName">
</td>
</tr>
<tr>
<td>Birth Date:</td>
<td>
<input type="text" name="birthDate">
</td>
<td>(Use format yyyy-mm-dd)</td>
</tr>

<tr>
<td>Email Address:</td>
<td>
<input type="text" name="emailAddr">
</td>
<td>(Use format name@company.com)</td>
</tr>
<tr>
<td>Gender:</td>
<td>
<input type="radio" name="gender" value="m" checked>Male<br>
<input type="radio" name="gender" value="f">Female
</td>
</tr>
<tr>
<td>Lucky number:</td>
<td>
<input type="text" name="luckyNumber">
</td>
<td>(A number between 1 and 100)</td>
</tr>
<tr>
<td>Favorite Foods:</td>
<td>
<input type="checkbox" name="food" value="z">Pizza<br>
<input type="checkbox" name="food" value="p">Pasta<br>
<input type="checkbox" name="food" value="c">Chinese
</td>
</tr>
<tr>
<td colspan=2>
<input type="submit" value="Send Data">
</td>
</tr>
</table>
</form>
You entered:<br>
Name: <c:out value="${param.userName}" /><br>
Birth Date: <c:out value="${param.birthDate}" /><br>
Email Address: <c:out value="${param.emailAddr}" /><br>
Gender: <c:out value="${param.gender}" /><br>
Lucky Number: <c:out value="${param.luckyNumber}" /><br>
Favorite Food:
<c:forEach items="${paramValues.food}" var="current">
<c:out value="${current}" /> 
</c:forEach>
</body>
</html>
...全文
91 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ztejiagn 2004-06-08
  • 打赏
  • 举报
回复
你没有在web.xml配置文件文件中指定tld文件的位置?
apacheshine 2004-06-08
  • 打赏
  • 举报
回复
ding chu lai

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧