|
一个页面中,多处要用到同一个变量来保存相对路径
<c:set var="RelativePath" value=""/>
为什么用这个变量来include时,这个表达式没有被解析?
JSP代码:
------
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
<title>JSTL: cut的使用</title>
</head>
<body bgcolor="#FFFFFF">
<hr>
<c:set var="RelativePath" value=""/>
<%@ include file="${RelativePath}module/tail.htmlf"%>
</body>
</html>
-----
错误提示:
------
org.apache.jasper.JasperException: /c_out2.jsp(11,0) File "/${RelativePath}module/tail.htmlf" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126)
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:384)
org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:417)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:515)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
edu.jmu.cheyo.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:50)
------
--
[m[1;34m※ 来源:·BBS 水木清华站 smth.org·[FROM: 219.228.231.*][m |
|