<%@ page language="java" contentType="text/html;charset=gbk"%>
<html>
<head>
<title>jap:include</title>
</head>
<body>
<form action="" method="post" name="form">
<jsp:include page="jspinclude.jsp" flush="true">
<jsp:param name="t" value="<%=request.getParameter("test")%>"/>
</jsp:include>
<br>
<input type="text" name="test">
<input type="submit" name="submit" value="测试">
</form>
</body>
</html>jspinclude.jsp的代码
<%@ page language="java" contentType="text/html; charset=gbk" language="java"
    pageEncoding="gbk"">
<html>
<head>
<title>jsp:include</title>
</head>
<body>
读取页面信息<%=request.getParameter("t") %>
</body>
</html>
产生的异常
org.apache.jasper.JasperException: /lesson01/test7.jsp(9,30) Attribute value request.getParameter("test") is quoted with " which must be escaped when used within the value
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:198)
 请教各位问题出现在哪里?非常感谢各位了

解决方案 »

  1.   

    request.getParameter("test") 
    这个确定有值的吗?
      

  2.   

    <form action="" method="post" name="form"> 
    <jsp:include page="jspinclude.jsp" flush="true"> 
    <jsp:param name="t" value=" <%=request.getParameter("test")%>"/> 
    </jsp:include> 
    <br> 
    <input type="text" name="test"> 
    <input type="submit" name="submit" value="测试"> 
    </form> 
    </body> 
    </html> 
    <%=request.getParameter("test")%>怎么会有值啊!
      

  3.   

    我没明白你这样写的意思,你要是在<jsp:include></jsp:include>之间传你本页面输入的参数?
    那你的包含页面不是也获取<%=request.getParameter("t") %> ,关系太乱了
      

  4.   

    <%=request.getParameter("test")%>必须要有值!
      

  5.   

    <jsp:include page="jspinclude.jsp" flush="true"> 
    <jsp:param name="t" value=" <%=request.getParameter('test')%>"/> 
    </jsp:include> 
      

  6.   

    <jsp:include page="jspinclude.jsp" flush="true"> 
    <jsp:param name="t" value=" <%=request.getParameter("test")%>"/> 
    </jsp:include> 
    表示给属性传值
    你有这个(t)属性吗
      

  7.   

    value='<%=request.getParameter("test")%>',value后面改成单引号试试吧
      

  8.   

    Attribute value request.getParameter("test") is quoted with " which must be escaped when used within the value 这里说的很明白了啊。是因为引号的原因
    支持quxiuer 的代码
      

  9.   

    <jsp:include page="jspinclude.jsp" flush="true"> 
    <jsp:param name="t" value=" <%=request.getParameter("test")%>"/> 
    </jsp:include> 如果在地址栏中后面添加 ?test=xxx
    有时候就没有问题了 我想最终的问题运行第一个页面的时候,不能使request.getParameter("test")获得值
      

  10.   

    <%@ page language="java" contentType="text/html;charset=gbk"%> 
    <html> 
    <head> 
    <title>jap:include </title> 
    </head> 
    <body> 
    <form action="" method="post" name="form"> 
    <jsp:include page="jspinclude.jsp" flush="true"> 
    <jsp:param name="t" value=" <%=request.getParameter(\"test\")%>"/> 
    </jsp:include> 
    <br> 
    <input type="text" name="test"> 
    <input type="submit" name="submit" value="测试"> 
    </form> 
    </body> 
    </html> 
    楼主 按照上面的方法做就可以了   虽然在编辑器中会显示有错  但是运行起来却没有问题,有可能是tomcat的版本不同导致的。jsp在编译jsp页面时,将<%=request.getParameter("searchtype")%>作为变量进行处理。因此,遇到里面的"会报错。楼主没事可以看看我的个人网站www.uuxiao.com中有相关讲解