一.JSP指令 JSP指令用来设置与整个JSP页面相关的属性。 % @ page language = " java " contentType = " text/html; charset=UTF-8 " pageEncoding = " UTF-8 " % ! DOCTYPE html html head meta charset ="UTF-8" title Include / title
一.JSP指令
JSP指令用来设置与整个JSP页面相关的属性。
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Include</title> </head> <body> <!-- jsp include 指令包含界面 --> <jsp:include page="second.jsp"></jsp:include> <!-- 使用form表单跳转 --> <!-- forward和form表单的action一样都是用来指向页面的 --> <%-- <jsp:forward page="second.jsp"></jsp:forward> --%> <form action="second.jsp" method="post"> <input type="text" name="name"><br> <input type="submit" value="跳转"> </form> </body> </html>
二.JSP隐含对象
JSP支持九个自动定义的变量,江湖人称隐含对象。这九个隐含对象的简介见下表: