1、概念
jsp本身就是一个servlet,在运行过程中,jsp需先转换为servlet代码,再进行编译运行,但只有在jsp第一次运行时才需要转换为servlet代码。。。jsp转换成servlet java class文件保存在tomcat\work文件下
2、基本语法
Declaration 声明
<%! %>
Scriplet
<% %>
Comment 注释
<%-- --%> html注释,对客户端可见
<%// %>
<%/* */%>
Expression 表达式
<%= %>
Directive 编译指令 表示 编译期间的指令
<%@Directive 属性=“属性值”%>
Directive有 page include taglib
page
<%@page import= "java.io.*" contentType="text/html;charset=gb2312"errorPage="url" isErrorPage="true/false"%>
include
<%@include file="url" %> 不传递参数
Action 运行期间的指令
jsp:include 动态包含程序,当该指令被执行到时才会被编译
jsp:forward 跳转到指定页面