【发布时间】:2012-04-16 02:30:41
【问题描述】:
我需要一些帮助,我想做一个程序并使用了
if(session.getAttribute("logged")!="1"){
String err="You must be logged in!!";
request.setAttribute( "error", err );
String nextJSP = "/login.jsp";
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
dispatcher.forward(request,response); }
%>
在一个jsp中,但是老板让我用jstl所以我改成:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:if test="${session.getAttribute('logged')!=null}">
<jsp:forward page="login.jsp">
</jsp:forward>
</c:if>
<c:if test="${session.getAttribute('logged')==null}">
<jsp:forward page="princ.jsp"> </jsp:forward>
</c:if>
我得到一个严重的错误:
"org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application "
我在互联网上搜索了一些修复,我已经将 javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar 放在我的库中,甚至将 javaee.jar 放在 Tomcat 库中,但仍然得到没有解决这个问题,有人可以帮助我吗? PS:我有 Eclipse Java EE IDE for Web Developers.(INDIGO) Tomcat 7.08
【问题讨论】: