1、Example1.jsp
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<% String str="This a String";%>
<jsp:forward page="JExample7_1.jsp" >
<jsp:param name="hellostr" value="<%=str%>" /> //在跳转页面时要传递的参数,hellostr=“value”
</jsp:forward>
2、Example2.jsp
<%@ page contentType="text/html; charset=gb2312" language="java"%>
<center>
<%
String str=request.getParameter("hellostr");
%>
<h3>传递的字符串是:<BR>
<%=str%>
</center>