include.jsp中内容<%!
public static final String str = "oh come on,baby.";
%>
<jsp:include page="content.jsp">
<jsp:param name="ref1" value="hello ,xiaoniu"/>
<jsp:param name="ref2" value="<%=str%>"/>
</jsp:include>
content.jsp中内容
<h1><%=request.getParameter("ref1" )%></h1>
<h1><%=request.getParameter("ref2" )%></h1>
我想把2个jsp整合成一个JSP 整理成 include.jsp 内容
<%!
public static final String str = "oh come on,baby.";
%>
<jsp:include page="include.jsp">
<jsp:param name="ref1" value="hello ,xiaoniu"/>
<jsp:param name="ref2" value="<%=str%>"/>
</jsp:include>
<h1><%=request.getParameter("ref1" )%></h1>
<h1><%=request.getParameter("ref2" )%></h1>这个jsp错在哪里呢 怎么整合成一个,新人求助。
public static final String str = "oh come on,baby.";
%>
<jsp:include page="content.jsp">
<jsp:param name="ref1" value="hello ,xiaoniu"/>
<jsp:param name="ref2" value="<%=str%>"/>
</jsp:include>
content.jsp中内容
<h1><%=request.getParameter("ref1" )%></h1>
<h1><%=request.getParameter("ref2" )%></h1>
我想把2个jsp整合成一个JSP 整理成 include.jsp 内容
<%!
public static final String str = "oh come on,baby.";
%>
<jsp:include page="include.jsp">
<jsp:param name="ref1" value="hello ,xiaoniu"/>
<jsp:param name="ref2" value="<%=str%>"/>
</jsp:include>
<h1><%=request.getParameter("ref1" )%></h1>
<h1><%=request.getParameter("ref2" )%></h1>这个jsp错在哪里呢 怎么整合成一个,新人求助。
然后把2个页面中html,head等一张页面只有一个的标签去其一个
使其引用的就是页面的内容,而不是一个网页
你的content.jsp,include.jsp都存在final String str 常量,当然不对啦。
String ref1 = "hello ,xiaoniu";
String ref2 = "oh come on,baby.";
%>
<h1><%=ref1%></h1>
<h1><%=ref2%></h1>