
<%--程序string.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html>
<head> <title>传参数页面</title> </head> <body>
<h4>该页面传递一个参数QQ,直线下是接受参数页面的内容。</h4>
<hr>
<request.setCharacterEncoding("UTF-8");/>
<jsp:include page="output.jsp">
<jsp:param value="QQ" name="username"/>
</jsp:include>
</body>
</html> <%--程序output.jsp--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html>
<head> <title>接收参数页面</title> </head> <body>
接收参数,并显示结果页面。<br>
<% String str=request.getParameter("username"); %> <font color="blue"size="12"><%=str %></font>你好,欢迎你访问!
</body>
</html>