错了,是出这样的异常:
Error: 500
Location: /test/jsp_include.jsp
Internal Servlet Error:org.apache.jasper.compiler.ParseException: C:\jakarta-tomcat-3.3.2\webapps\test\jsp_include.jsp(8,57) Attribute name has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:485)
......我把
<jsp:include page="two.jsp" flush="true" >
<jsp:param name="a1" value="<%=request.getParameter("name")%>"/>
<jsp:param name="a2" value="<%=request.getParameter("password")%>"/>
</jsp:include>改成<jsp:include page="two.jsp" flush="true" />
就没事,好象这2句有什么问题?
<jsp:param name="a1" value="<%=request.getParameter("name")%>"/>
<jsp:param name="a2" value="<%=request.getParameter("password")%>"/>

解决方案 »

  1.   

    static.html<html>
    <body>
    <form method=post action="jsp_include.jsp">
    <table>
    <tr>
    <td>please input your name:</td></tr>
    <tr><td>
    <input type=text name=name>
    </td></tr>
    <tr><td>input you password:</td>
    <td>
    <input type=text name=password>
    </td>
    </tr>
    <tr>
    <td>
    <input type=submit value=login>
    </td>
    </tr>
    </table>
    </body>
    </html>
      

  2.   

    two.jsp<%@ page language="java" contentType="text/html;charset=gb2312" %>
    举例说明include的工作原理:<br>
    this is a1=<%request.getParameter("a1")%><br>
    this is a2=<%request.getParameter("a2")%><br>
    <%out.println("hello from two.jsp");%>
      

  3.   

    this is a1=<%=request.getParameter("a1")%><br>
    this is a2=<%=request.getParameter("a2")%><br>
      

  4.   

    <%@ page language="java" contentType="text/html;charset=gb2312"%>看代码好累!
      

  5.   

    把two.jsp中的 <%@ page language="java" contentType="text/html;charset=gb2312"%>
    去掉,一个jsp文件中只允许出现一次
      

  6.   

    this is a1=<%request.getParameter("a1")%><br>
    this is a2=<%request.getParameter("a2")%><br>
    这是错了,不过我改了之后还是这样的问题。
      

  7.   

    two.jsp中的<%@ page....%>也去掉了,还是这样。
      

  8.   

    <%@ page language="java" contentType="text/html;charset=gb2312"%>你的是test/html!
    我现在要走了,你其实应该告诉我们异常的!
    我刚做过测试,是可以的!
    要不这样,你运行two.jsp就可以!很简单!
      

  9.   

    这是two.jsp,你运行一下:<%@ page language="java" contentType="text/html;charset=gb2312" %>
    举例说明include的工作原理:<br>
    this is a1=<%=request.getParameter("a1")%><br>
    this is a2=<%=request.getParameter("a2")%><br>
    <%out.println("hello from two.jsp");%>
      

  10.   

    最后我想说,飞思出的<<jsp应用开发详解>>真%—%¥%垃圾two.jsp没问题,static.html也没错,就jsp_include.jsp有问题:<%@ page contentType="text/html; charset=gb2312" language="java" %>
    <html>
    <body>
    <%@ include file="static.html" %>
    <%//只是把文件包含进来%>
    <a href="two.jsp">goto two--></a><br>
    this examples show include works
    <jsp:include page="two.jsp" flush="true">
    <jsp:param name="a1" value="<%=request.getParameter("name")%>"/>
    <jsp:param name="a2" value="<%=request.getParameter("password")%>"/>
    </jsp:include>
    </body>
    </html>估计在static.html中name 和 password没提交,就出错了。
    我改成这样都没错
    <jsp:param name="a1" value=""/>
    <jsp:param name="a2" value=""/>有高手看看么,哎,我每个问题到这都问不清楚。
      

  11.   

    异常这样的
    Error: 500
    Location: /test/jsp_include.jsp
    Internal Servlet Error:org.apache.jasper.compiler.ParseException: C:\jakarta-tomcat-3.3.2\webapps\test\jsp_include.jsp(8,57) Attribute name has no value
    at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:485)
    ......主要是这条 Attribute name has no value谁知道为什么啊?解释不清楚。
      

  12.   

    你说直接运行了jsp_include.jsp吧 这个错误应该是空指针,是说从页面得到的参数没有 ,应该是这样的写程序 
    <jsp:param name="a1" value="<%=request.getParameter("name")?null%>"/>
    <jsp:param name="a2" value="<%=request.getParameter("password")==null?"":request.getParameter("password")%>"/>
      

  13.   

    <%@ page include file="static.html" %>