smp1.html代码:<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<!--<meta name="description" content="密码,登陆">
<meta name="keywords" content="密码,登陆">-->
<title>静态文件</title></head>
<body>
<form name="fr2" method="post" action="menu7.jsp">
<p align="center">用户名:
<input type="text" name="username" id="username">
密码:
<input type="password" name="password" id="password">
</p>
<p align="center">
<input type="submit" value="提交" name="sub1">
</p></form>
</body></html>
menu6.jsp<%@ page contentType="text/html;charset=gb2312" language="java"%>
<html>
<head>
<title>动态文件</title>
</head>
<body>
动态文件内容:
<br>
用户名:<%=request.getParameter("username")%>
<br>
密码:<%=request.getParameter("password")%>
<br>
<% out.print("这是menu6.jsp的内容");%>
</body>
</html>menu7.jsp
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>menu7.jsp文件</title>
</head>
<body>
<%@ include file="smp1.html"%>
<%//把文件包含了进来%>
<a href="menu6.jsp">转向menu6.jsp文件</a>
举例说明include的原理
<br >
<jsp:include page="menu6.jsp" flush="true">
<jsp:param name="username" value="<%=request.getParameter("username")%>"/>
<jsp:param name="password" value="<%=request.getParameter("password")%>"/>
</jsp:include>
</body>
</html>
总是提示以下错误: /menu7.jsp(13,37) Attribute value request.getParameter("username") is quoted with " which must be escaped when used within the value
改了N次也没找到错误,希望大家帮忙看下,谢了!
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<!--<meta name="description" content="密码,登陆">
<meta name="keywords" content="密码,登陆">-->
<title>静态文件</title></head>
<body>
<form name="fr2" method="post" action="menu7.jsp">
<p align="center">用户名:
<input type="text" name="username" id="username">
密码:
<input type="password" name="password" id="password">
</p>
<p align="center">
<input type="submit" value="提交" name="sub1">
</p></form>
</body></html>
menu6.jsp<%@ page contentType="text/html;charset=gb2312" language="java"%>
<html>
<head>
<title>动态文件</title>
</head>
<body>
动态文件内容:
<br>
用户名:<%=request.getParameter("username")%>
<br>
密码:<%=request.getParameter("password")%>
<br>
<% out.print("这是menu6.jsp的内容");%>
</body>
</html>menu7.jsp
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>menu7.jsp文件</title>
</head>
<body>
<%@ include file="smp1.html"%>
<%//把文件包含了进来%>
<a href="menu6.jsp">转向menu6.jsp文件</a>
举例说明include的原理
<br >
<jsp:include page="menu6.jsp" flush="true">
<jsp:param name="username" value="<%=request.getParameter("username")%>"/>
<jsp:param name="password" value="<%=request.getParameter("password")%>"/>
</jsp:include>
</body>
</html>
总是提示以下错误: /menu7.jsp(13,37) Attribute value request.getParameter("username") is quoted with " which must be escaped when used within the value
改了N次也没找到错误,希望大家帮忙看下,谢了!
解决方案 »
- 求助~Finally报错
- 请教各位几个关闭JAVA基本概念的问题!有兴趣朋友可以来看看
- 新手求救莫名404错误
- 一般下载网站 文件地址这么长是怎么实现的
- 关于 usebean和 session的问题
- 如何使用JSP页面把一个文件夹的图片分页显示出来?急!急!急!急!在线等!!!
- Hibernate事务问题
- 紧急~~~!!连数据库出错拉~~怪事。。。在线等Help~~~
- .jsp 文件 Parse 成 .java 文件的字符集问题 for tomcat4
- 急!!!请教各位,编译好的servlet类应该放在什么目录下呢?
- spring的测试,?求助 ???
- HTTP Status 404 - /servlet/HelloServlet
username和Password smp1.html输入的数据
能否在menu6.jsp 页面显示
文件和menu7.jsp
的编码格式不一致!!!!!
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>menu7.jsp文件 </title>
</head>
<body>
<%@ include file="smp1.html"%>
<%//把文件包含了进来%>
<a href="menu6.jsp">转向menu6.jsp文件 </a>
举例说明include的原理
<br > 这样好像不行吧,
还有你没有必要在menu7.jsp 页面把输入页面包含进来啊
你可以像上面一样使用超连接跳转来实现
<jsp:include page="">//先将这个page编译完,再包含进来
<jsp:include page="">//先将这个page编译完,再包含进来 楼主还是搞清楚上面两种方式的区别吧,可以在tomcat中查看有jsp生成的java文档,一种生成的是一个文档,一个是生成2个文档,搞清楚这个了就明白为什么不行了。其实你的错误原因也就在这里面