<%@ page contentType="text/html;charset=GBK" %><h1> 使用include传递参数</h1>
<jsp:include page="include1.jsp">
<jsp:param name="name" value="Tom and Jack "/>
<jsp:param name="age" value="22"/>
</jsp:include>
为什么这段代码编译不过去啊,请问错在哪里
我是把两个文件放在同一个文件夹下
<%@ page contentType="text/html;charset=GBK" %>
<html>
<head>
<title>include动作指令</title>
</head>
<body>
<%
String name=request.getParameter("name");
String age=request.getParameter("age");
out.print("name="+name+"<br>");
out.print("age="+age+"<br>");
%>
</body>
</html>
<jsp:include page="include1.jsp">
<jsp:param name="name" value="Tom and Jack "/>
<jsp:param name="age" value="22"/>
</jsp:include>
为什么这段代码编译不过去啊,请问错在哪里
我是把两个文件放在同一个文件夹下
<%@ page contentType="text/html;charset=GBK" %>
<html>
<head>
<title>include动作指令</title>
</head>
<body>
<%
String name=request.getParameter("name");
String age=request.getParameter("age");
out.print("name="+name+"<br>");
out.print("age="+age+"<br>");
%>
</body>
</html>
要不用dispatcher类传一下值
include1.jsp
建议路径写成 工程名/包名/include1.jsp${pageContext.request.contextPath}/inclde1.jsp或者
<c:set var="ctx" value="${pageContext.request.contextPath}"/>${ctx}/inclde1.jsp