- <body>
- <h3>原始页</h3>
- <jsp:include page="Demo.jsp">
- <jsp:param value="潇潇" name="name"/>
- </jsp:include>
- </body>
- <body>
- <h3>目标页Demo.jsp</h3>
- <%=request.getParameter("name") %>
- </body>
此时目标页显示的参数name是不能正确显示出来的,显示的是乱码,我们需要这样改
- <body>
- <%request.setCharacterEncoding("utf-8"); %>
- <h3>原始页</h3>
- <jsp:include page="Demo.jsp">
- <jsp:param value="潇潇" name="name"/>
- </jsp:include>
- </body>
在发送参数的那个页面加上对request的编码格式设定就好