1)脚本元素有三种格式:(视频下载) (全部书籍)

   i)表达式:比如下面例子的:<%=++accessCount%>:转换代码插入到转成的Servlet的service方法。

   ii)Scriptlet:比如下面例子的: <% if (called() < 0.5) { %>  转换代码插入到转成的Servlet的service方法。

   iii)声明:比如下面例子的:<%!private int accessCount = 0;%> 或 <%!double called() { return Math.random(); 转换代码插入到转成的Servlet的service方法之外。

2)指令:比如page指令<%@ page contentType="控制整个页面或者include指令<%@ include file="url"

详情请见:http://www.mark-to-win.com/index.html?content=Jsp/jspUrl.html&chapter=Jsp/jsp3_web.html#ScriptingElementincludeWhat

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!