首页 > 代码库 > JSP_include指令和<jsp:include>
JSP_include指令和<jsp:include>
包含三个文件:jsp_include.jsp, static.html, two.jsp
环境:tomcat7.0, myeclipse10
1.jsp_include.jsp
<%@ page contentType="text/html;charest=UTF-8" language="java" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <body><%@ include file="static.html"%> <a href = http://www.mamicode.com/"two.jsp">goto two-->
>在版本7.0以上的tomcat中,连续使用引号会出现错误,解决方法如下:
Tomcat - 解决which must be escaped when used within the value错误
2.static.html<!DOCTYPE html> <html> <body><form method=post action="jsp_include.jsp"> <table> <tr><td>please input your name: </td></tr> <tr><td><input type=text name=name></td></tr> <tr><td>please input your password: </td></tr> <tr><td><input type=text name=password></td></tr> <tr><td><input type=submit value=http://www.mamicode.com/login> >
3.two.jsp<%@ page contentType="text/html;charest=UTF-8" language="java" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <br> this is a1=<%=request.getParameter("a1") %> <br> this is a2=<%=request.getParameter("a2") %> <br> <% out.println("hello from two.jsp"); %>代码我上传到了我的资源。。在审核,有时间我会帖上链接方便大家下载阅读。
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。