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

jstl错误 求大神解决一下
1 <%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
2 <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
3 <%
4 String path = request.getContextPath();
5 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
6 %>
7 <c:set var="All_Books" value=" ${empty requestScope.ALL_Books}"></c:set>
8 <c:if test="All_Books">
9 <c:redirect url="<%=path %>/servlet/BooksServlet?code=4"></c:redirect>
10</c:if>




org.apache.jasper.JasperException: /index.jsp(9,18) attribute for %>" is not properly terminated
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:132)
org.apache.jasper.compiler.Parser.parseAttributeValue(Parser.java:240)
org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:205)
org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:148)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1208)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1634)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:978)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1246)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422)
org.apache.jasper.compiler.Parser.parse(Parser.java:130)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


------解决方案--------------------
<c:redirect url='"<%=path %>"+"/servlet/BooksServlet?code=4"
'></c:redirect>