<jsp:include>参数问题
jsp_include.jsp除去了一些不要的代码<%@includefile="static.jsp"%><ahref="static.jsp">goto-static...
jsp_include.jsp 除去了一些不要的代码
<%@ include file="static.jsp"%>
<a href="static.jsp">goto-static--></a>
<jsp:include page="action.jsp" flush="true">
<jsp:param name="name" value="<%=request.getParameter("name")%>"></jsp:param>
<jsp:param name="password" value="<%=request.getParameter("password")%>"></jsp:param>
</jsp:include>
-----------------------------------------
action.jsp 除去了一些不要的代码
this is a1=<%=request.getParameter("name") %>
this is a2=<%=request.getParameter("password") %>
------------------------------------------
static.jsp 除去了一些不要的代码
<form action="jsp_include.jsp" method="post">
<table><tr><td>name:</td><td><input type="text" name="name"></td></tr>
<tr><td>password:</td><td><input type="password" name="password"></td></tr>
<tr><td></td> <td><input type="submit" name="submit" value="提交"></td></tr>
在jsp:include中出现参数错误?
type Exception report
message /jsp_include.jsp (line: 20, column: 35) Attribute value
request.getParameter("name") is quoted with " which must be escaped when used
within the value
description The server encountered an internal error that prevented
it from fulfilling this request.
具体界面如上 展开
<%@ include file="static.jsp"%>
<a href="static.jsp">goto-static--></a>
<jsp:include page="action.jsp" flush="true">
<jsp:param name="name" value="<%=request.getParameter("name")%>"></jsp:param>
<jsp:param name="password" value="<%=request.getParameter("password")%>"></jsp:param>
</jsp:include>
-----------------------------------------
action.jsp 除去了一些不要的代码
this is a1=<%=request.getParameter("name") %>
this is a2=<%=request.getParameter("password") %>
------------------------------------------
static.jsp 除去了一些不要的代码
<form action="jsp_include.jsp" method="post">
<table><tr><td>name:</td><td><input type="text" name="name"></td></tr>
<tr><td>password:</td><td><input type="password" name="password"></td></tr>
<tr><td></td> <td><input type="submit" name="submit" value="提交"></td></tr>
在jsp:include中出现参数错误?
type Exception report
message /jsp_include.jsp (line: 20, column: 35) Attribute value
request.getParameter("name") is quoted with " which must be escaped when used
within the value
description The server encountered an internal error that prevented
it from fulfilling this request.
具体界面如上 展开
1个回答
展开全部
我在你的jsp_include.jsp文件中代码改成如下所示就好了:
<jsp:include page="static.jsp"></jsp:include>
<a href="static.jsp">goto-static--></a>
<%
String name=request.getParameter("name");
String psw = request.getParameter("password");
System.out.println("姓名:"+name+"\t密码:"+psw);
%>
<jsp:include page="action.jsp" flush="true">
<jsp:param name="name" value="<%=name%>"></jsp:param>
<jsp:param name="password"
value="<%=psw%>"></jsp:param>
</jsp:include>
<jsp:include page="static.jsp"></jsp:include>
<a href="static.jsp">goto-static--></a>
<%
String name=request.getParameter("name");
String psw = request.getParameter("password");
System.out.println("姓名:"+name+"\t密码:"+psw);
%>
<jsp:include page="action.jsp" flush="true">
<jsp:param name="name" value="<%=name%>"></jsp:param>
<jsp:param name="password"
value="<%=psw%>"></jsp:param>
</jsp:include>
更多追问追答
追问
我试了这种,貌似不是这个问题 是参数改成什么都没用,还有就是单引号那种也改了 也没用
追答
我就改了你的jsp_include.jsp这个文件,然后就行了。你试试把我的这段代码粘贴到你的jsp_include.jsp文件中试试。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询