<%%> 局部变量
<%!%> 定义 全局变量、方法、类
<%=%>输出一个 变量 或一个 具体内容 。
设置编码方式;contentType pageEncoding,区别是:contentType指的是JSP文件本身的编码,而contentType中的charset指的是 服务器发给客户端的内容编码
当网页出现错误进行跳转
首先建立一个跳转后的错误网页jsp
<%@ page language="java" contentType="text/html" pageEncoding="GBK"%>
<%@ page isErrorPage="true"%><%--once the web page get error ,it will be jump tihs page --%>
<h1>oh, my god ,you web get error</h1>
需要监测的jsp需要 添加的代码
<%@ page language="java" contentType="text/html" pageEncoding="GBK"%>
<%@ page errorPage="error.jsp"%>