日期:2014-05-17  浏览次数:20735 次

请帮忙看看
<%@ taglib prefix="c" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page contentType="text/html; charset=gb2312" language="java"%>

<jsp:useBean id="now" class="java.util.Date"/>
<fmt:setLocale value="zh-cn"/>

<%@page import="java.util.*"%>
<html>
<head>
<title>JSTL:这里是一个简单的JSTL应用</title></head>
<body bgcolor="#FFFFFF">
<h3>这里是一个简单的JSTL应用</h3>
<%
Collection customers=new ArrayList();
customers.add(new String("guest1"));
customers.add(new String("guest2"));
customers.add(new String("guest3"));
request.setAttribute("customers",customers);
%>
<h4>Customers in the request:</h4>
<c:set var="customer" scope="session" value="${requestScope.customers}"/>
<c:forEach var="customer" items="${customers}">
<c:out value="${customer}"/><br>
</c:forEach>
<br>
现在的时间是:
<br>
<fmt:timeZone value="GMT">
<fmt:formatDate value="${now}" type="both" dateStyle="full" timeStyle="full"/>
</fmt:timeZone></body></html>

用myeclipse
老提示Multiple annotations found at this line:
- Unknown tag (c:set).
- Unknown tag (c:set).

Collection is a raw type. References to generic type Collection<E> should be parameterized

------解决方案--------------------
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 加上试试
------解决方案--------------------
哦 没看见你加了的
------解决方案--------------------
探讨
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 加上试试

------解决方案--------------------
标签库引入的不对
------解决方案--------------------
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
标签库写的也不对,<%@taglib ....>不能有空格
------解决方案--------------------
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>


另外还要导入jstl.jar和standard.jar