-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathJava-Server-Pages.html
1 lines (1 loc) · 50.1 KB
/
Java-Server-Pages.html
1
<!-- build time:Wed Mar 09 2022 10:17:57 GMT+0800 (GMT+08:00) --><!doctype html><html class="theme-next mist" lang="zh-Hans"><head><meta name="generator" content="Hexo 3.8.0"><meta name="google-site-verification" content="7Tau9WyVgxnsEY9oYedu9g0U6_8akOX3wiKbaYcrg9A"><meta name="baidu-site-verification" content="EVwLiaxdxX"><link href="/css/xps13.css" rel="stylesheet" type="text/css"><link href="/css/message.css" rel="stylesheet" type="text/css"><link href="//fonts.googleapis.com/css?family=Baloo+Bhaijaan|Inconsolata|Josefin+Sans|Montserrat" rel="stylesheet"><script type="text/javascript" src="/js/jquery-1.11.3.min.js"></script><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv="Cache-Control" content="no-transform"><meta http-equiv="Cache-Control" content="no-siteapp"><link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css"><link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css"><meta name="keywords" content="servlet&jsp,"><link rel="alternate" href="/atom.xml" title="MrBird" type="application/atom+xml"><link rel="shortcut icon" type="image/x-icon" href="/bird.png?v=5.1.1"><meta name="description" content="scripletJSP页面可以直接书写Java 代码,Java代码要用&lt;% %&gt;包裹起来,&lt;% %&gt;代码块也被成为scriplet。可以使用page指令的import导入Java类型,否则scriplet里的Java类必须使用全类名。如:123456789101112&lt;%@ page import="java.util.Date"%&gt;&lt;%@ page im"><meta name="keywords" content="servlet&jsp"><meta property="og:type" content="article"><meta property="og:title" content="Java Server Pages"><meta property="og:url" content="http://mrbird.cc/Java-Server-Pages.html"><meta property="og:site_name" content="MrBird"><meta property="og:description" content="scripletJSP页面可以直接书写Java 代码,Java代码要用&lt;% %&gt;包裹起来,&lt;% %&gt;代码块也被成为scriplet。可以使用page指令的import导入Java类型,否则scriplet里的Java类必须使用全类名。如:123456789101112&lt;%@ page import="java.util.Date"%&gt;&lt;%@ page im"><meta property="og:locale" content="zh-Hans"><meta property="og:updated_time" content="2020-01-21T03:30:03.131Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Java Server Pages"><meta name="twitter:description" content="scripletJSP页面可以直接书写Java 代码,Java代码要用&lt;% %&gt;包裹起来,&lt;% %&gt;代码块也被成为scriplet。可以使用page指令的import导入Java类型,否则scriplet里的Java类必须使用全类名。如:123456789101112&lt;%@ page import="java.util.Date"%&gt;&lt;%@ page im"><script type="text/javascript" id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Mist",sidebar:{position:"left",display:"always",offset:12,offset_float:0,b2t:!1,scrollpercent:!0},fancybox:!1,motion:!1}</script><title>Java Server Pages | MrBird</title></head><body ondragstart="return!1" class="animsition" lang="zh-Hans" style="overflow-x:hidden;padding-left:280px"><script type="text/javascript" src="/js/mo.min.js"></script><style>body{text-rendering:geometricPrecision!important;font-family:'Josefin Sans','PingFang SC'!important;-webkit-font-smoothing:antialiased!important;-webkit-text-size-adjust:100%!important;background-color:#f4f6f7}@media (min-width:768px) and (max-width:991px){body .header-innerr{width:700px!important}}.header-innerr{margin:0 auto;padding:100px 0 70px;width:880px}@media (min-width:1600px){.container .header-innerr{width:996px}}.header-innerr{position:relative}.header-innerr{padding:0}.header-innerr:after,.header-innerr:before{content:" ";display:table}.header-innerr:after{clear:both}@media (max-width:767px){.header-innerr{width:auto;padding:10px;margin-bottom:-20px}}</style><div class="container sidebar-position-left page-post-detail"><div class="headband"></div><header id="header" class="header"><div class="header-inner"><div class="site-brand-wrapper"><div class="site-meta"><link href="https://fonts.font.im/css?family=Merienda" rel="stylesheet"><div class="custom-logo-site-title"></div><h1 class="site-subtitle" itemprop="description"></h1></div><div class="site-nav-toggle"><button><span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span></button></div></div><nav class="site-nav"><div class="site-search"><div class="popup search-popup local-search-popup"><div class="local-search-header clearfix"><span class="search-icon"><i class="fa fa-search"></i> </span><span class="popup-btn-close"><i class="fa fa-times-circle"></i></span><div class="local-search-input-wrapper"><input autocomplete="off" placeholder="Search" spellcheck="false" type="text" id="local-search-input"></div></div><div id="local-search-result"></div></div></div></nav></div><div class="header-innerr"></div></header><main id="main" class="main"><div class="main-inner"><div class="content-wrap"><div id="content" class="content"><div id="posts" class="posts-expand"><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><link itemprop="mainEntityOfPage" href="http://mrbird.cc/Java-Server-Pages.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="MrBird"><meta itemprop="description" content=""><meta itemprop="image" content="/images/blogImage.jpg"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="MrBird"></span><header class="post-header"><h2 class="post-title" itemprop="name headline">Java Server Pages</h2><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i> </span><span class="post-meta-item-text"></span> <time title="创建于" itemprop="dateCreated datePublished" datetime="2016-11-07T08:58:18+08:00">2016-11-07 </time></span><span></span> <span class="post-meta-divider">|</span> <span class="page-pv"><i class="fa fa-laptop"></i> Visit count <span class="busuanzi-value" id="busuanzi_value_page_pv"></span></span></div></header><div class="post-body" itemprop="articleBody"><h2 id="scriplet"><a href="#scriplet" class="headerlink" title="scriplet"></a>scriplet</h2><p>JSP页面可以直接书写Java 代码,Java代码要用<% %>包裹起来,<% %>代码块也被成为scriplet。可以使用page指令的import导入Java类型,否则scriplet里的Java类必须使用全类名。</p><p>如:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">import</span>=<span class="string">"java.util.Date"</span>%></span></span><br><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">import</span>=<span class="string">"java.text.DataFormat"</span>%></span></span><br><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span><span class="tag"><<span class="name">title</span>></span>Today's date<span class="tag"></<span class="name">title</span>></span><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">DateFormat</span> <span class="attr">df</span> = <span class="string">DateFormat.getDateInstance(DateFormat.LONG);</span></span></span><br><span class="line"><span class="tag"> <span class="attr">String</span> <span class="attr">s</span> = <span class="string">df.format(new</span> <span class="attr">Date</span>());</span></span><br><span class="line"><span class="tag"> <span class="attr">out.println</span>("<span class="attr">Today</span> <span class="attr">is</span> " + <span class="attr">s</span>);</span></span><br><span class="line"><span class="tag"> %></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><a id="more"></a><h2 id="隐式对象"><a href="#隐式对象" class="headerlink" title="隐式对象"></a>隐式对象</h2><table><tr><th>对象</th><th>描述</th></tr><tr><td>request</td><td>HttpServletRequest类的实例</td></tr><tr><td>response</td><td>HttpServletResponse类的实例</td></tr><tr><td>out</td><td>PrintWriter类的实例,用于把结果输出至网页上</td></tr><tr><td>session</td><td>HttpSession类的实例</td></tr><tr><td>application</td><td>ServletContext类的实例,与应用上下文有关</td></tr><tr><td>config</td><td>ServletConfig类的实例</td></tr><tr><td>pageContext</td><td>PageContext类的实例,提供对JSP页面所有对象以及命名空间的访问</td></tr><tr><td>page</td><td>类似于Java类中的this关键字</td></tr><tr><td>Exception</td><td>Exception类的对象,代表发生错误的JSP页面中对应的异常对象</td></tr></table><p>获取<code>HttpServletRequest</code>对象的userName参数:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">String</span> <span class="attr">userName</span> = <span class="string">request.getParameter(</span>"<span class="attr">userName</span>");</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><p><code>PageContext</code>实用方法为存取属性:<code>setAttribute()</code>和<code>getAttribute()</code>。</p><p>setAttribute方法签名:</p><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">abstract</span> <span class="keyword">void</span> <span class="title">setAttribute</span><span class="params">(String name, Object value, <span class="keyword">int</span> scope)</span></span>;</span><br></pre></td></tr></table></figure><p></p><p>scope值可以取:PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, APPLICATION_SCOPE。</p><p>如,下面scriplet在ServletRequset中保存了一个属性:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> //<span class="attr">product</span> <span class="attr">is</span> <span class="attr">a</span> <span class="attr">Java</span> <span class="attr">object</span></span></span><br><span class="line"><span class="tag"> <span class="attr">pageContext.setAttribute</span>("<span class="attr">product</span>",<span class="attr">product</span>,<span class="attr">pageContext.REQUEST.SCOPE</span>);</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><p>等价于:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">request.setAttribute</span>("<span class="attr">product</span>",<span class="attr">product</span>);</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><p><code>out</code>对象类似于在<code>HttpServletResponse</code>中调用<code>getWritter()</code>之后得到的<code>java.io.PrintWriter</code>,如在页面输出Welcome:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">out.println</span>("<span class="attr">Welcome</span>");</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><h2 id="指令"><a href="#指令" class="headerlink" title="指令"></a>指令</h2><h3 id="page指令"><a href="#page指令" class="headerlink" title="page指令"></a>page指令</h3><p>常用指令表:</p><table><tr><th>属性</th><th>定义</th></tr><tr><td>language=”ScriptLanguage”</td><td>指定JSP Container用什么语言来编译,目前只支持JAVA语言。默认为JAVA</td></tr><tr><td>extends=”className”</td><td>定义此JSP网页产生的Servlet是继承哪个</td></tr><tr><td>import=”importList”</td><td>定义此JSP网页要使用哪些Java API</td></tr><tr><td>session=”true|false”</td><td>决定此页面是否使用session对象。默认为true</td></tr><tr><td>buffer=”none|size in kb”</td><td>决定输出流(Input stream)是否又缓冲区。默认为8kb</td></tr><tr><td>autoFlush=”true|false”</td><td>决定输出流的缓冲区慢了后是否需要自动清除,缓冲区慢了后会产生异常错误(Exception).默认为true</td></tr><tr><td>isThreadSafe=”true|false”</td><td>是否支持线程。默认为true</td></tr><tr><td>errorPage=”url”</td><td>如果此页发生异常,网页会重新指向一个url</td></tr><tr><td>isErrorPage=”true|false”</td><td>表示此页面是否为错误处理页面。默认为false</td></tr><tr><td>contentType=”text/html;charset=gb2312”</td><td>表示MIME类型和JSP的编码方式。笔者使用例左</td></tr><tr><td>pageEncoding=”ISO-8859-1”</td><td>编码方式。</td></tr><tr><td>isELLgnored=”true|false”</td><td>表示是否在此JSP页面中EL表达式。true则忽略,反之false则支持。默认为false </td></tr></table><p>设置jsp中用到的语言,用到的是java,也是目前唯一有效的设定:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">language</span>=<span class="string">"java"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>jsp页面所用到的类:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">import</span>=<span class="string">"java.sql.*"</span>% ></span></span><br></pre></td></tr></table></figure><p></p><p>设置该jsp页面出现异常时所要转到的页面,如果没设定,容器将使用当前的页面显示错误信息:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">errorPage</span>=<span class="string">"error.jsp"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>设置该jsp页面是否作为错误显示页面,默认是false,如果设置为true,容器则会在当前页面生成一个exception对象:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">isErrorPage</span>=<span class="string">"true"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>设置页面文件格式和编码方式:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">contentType</span>=<span class="string">"text/html;charset=utf-8"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>设置容器以多线程还是单线程运行该jsp页面,默认是true,是多线程。设置为false,则以单线程的方式运行该jsp页面:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">isThreadSafe</span>=<span class="string">"true"</span>% ></span></span><br></pre></td></tr></table></figure><p></p><p>设置该jsp页面是否可以用到session对象(jsp内置对象,为web容器创建),默认是true,能用到session.设置为false,则用不到:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">session</span>=<span class="string">"true"</span>% ></span></span><br></pre></td></tr></table></figure><p></p><h3 id="include指令"><a href="#include指令" class="headerlink" title="include指令"></a>include指令</h3><p>语法:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">include</span> <span class="attr">file</span>=<span class="string">"url"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>被引用的文件扩展名为jspf(JSP fragment)。</p><h2 id="脚本元素"><a href="#脚本元素" class="headerlink" title="脚本元素"></a>脚本元素</h2><p>scriplet前面介绍了,这里不在赘述。</p><h3 id="表达式"><a href="#表达式" class="headerlink" title="表达式"></a>表达式</h3><p>以<%=开头,%>结束:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Today is <span class="tag"><<span class="name">%=java.util.Calendar.getInstance().getTime()%</span>></span></span><br></pre></td></tr></table></figure><p></p><p>等价于:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Today is</span><br><span class="line"><span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">out.println</span>(<span class="attr">java.util.Calendar.getInstance</span>()<span class="attr">.getTime</span>());</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><h3 id="声明"><a href="#声明" class="headerlink" title="声明"></a>声明</h3><p>可以声明能够在JSP页面中实用的变量和方法,声明用<%!%>包裹起来,比如在JSP页面中声明一个getTodaysDate的方法:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%!</span></span></span><br><span class="line"><span class="tag"> <span class="attr">public</span> <span class="attr">String</span> <span class="attr">getTodaysDate</span>() {</span></span><br><span class="line"><span class="tag"> <span class="attr">return</span> <span class="attr">new</span> <span class="attr">java.util.Date</span>(); </span></span><br><span class="line"><span class="tag"> } </span></span><br><span class="line"><span class="tag">%></span></span><br><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span><span class="tag"><<span class="name">title</span>></span>Declarations<span class="tag"></<span class="name">title</span>></span><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> Today is <span class="tag"><<span class="name">%=getTodayDate()%</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><p>我们可以利用声明覆盖实现类中的init和destory方法:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%!</span></span></span><br><span class="line"><span class="tag"> <span class="attr">public</span> <span class="attr">void</span> <span class="attr">jspInit</span>() {</span></span><br><span class="line"><span class="tag"> <span class="attr">System.out.println</span>("<span class="attr">jspInit</span> <span class="attr">...</span>");</span></span><br><span class="line"><span class="tag"> }</span></span><br><span class="line"><span class="tag"> <span class="attr">public</span> <span class="attr">void</span> <span class="attr">jspDestory</span>() {</span></span><br><span class="line"><span class="tag"> <span class="attr">System.out.println</span>("<span class="attr">jspDestory</span> <span class="attr">...</span>");</span></span><br><span class="line"><span class="tag"> }</span></span><br><span class="line"><span class="tag">%></span></span><br></pre></td></tr></table></figure><p></p><h3 id="关闭脚本"><a href="#关闭脚本" class="headerlink" title="关闭脚本"></a>关闭脚本</h3><p>为了页面的整洁性,现在一般用EL,JSTL取代脚本元素,我们可以设置关闭脚本元素:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">jsp-config</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp-property-group</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">url-pattern</span>></span>*.jsp<span class="tag"></<span class="name">url-pattern</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">scripting-invalid</span>></span>true<span class="tag"></<span class="name">scripting-invalid</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">jsp-property-group</span>></span> </span><br><span class="line"><span class="tag"></<span class="name">jsp-config</span>></span></span><br></pre></td></tr></table></figure><p></p><h2 id="动作"><a href="#动作" class="headerlink" title="动作"></a>动作</h2><p>动作会被编译为执行某个操作的Java代码,例如访问某个Java对象,或者调用某个方法。</p><h3 id="useBean"><a href="#useBean" class="headerlink" title="useBean"></a>useBean</h3><p>如:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">title</span>></span>useBean<span class="tag"></<span class="name">title</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:useBean</span> <span class="attr">id</span>=<span class="string">"today"</span> <span class="attr">class</span>=<span class="string">"java.util.Date"</span>/></span></span><br><span class="line"> <span class="tag"><<span class="name">%=today%</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><p>运行页面后,会在浏览器输出当前日期和时间。</p><h3 id="存取属性"><a href="#存取属性" class="headerlink" title="存取属性"></a>存取属性</h3><p>有Employee JavaBean,现在页面中存取属性值:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">title</span>></span>getProperty and setProperty<span class="tag"></<span class="name">title</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:useBean</span> <span class="attr">id</span>=<span class="string">"employee"</span> <span class="attr">class</span>=<span class="string">"com.mrbird.entity.Employee"</span>/></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:setProperty</span> <span class="attr">name</span>=<span class="string">"employee"</span> <span class="attr">property</span>=<span class="string">"firstName"</span> <span class="attr">value</span>=<span class="string">"Mrbird"</span>/></span></span><br><span class="line"> First Name:<span class="tag"><<span class="name">jsp:getProperty</span> <span class="attr">name</span>=<span class="string">"employee"</span> <span class="attr">property</span>=<span class="string">"firstName"</span>/></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><h3 id="include"><a href="#include" class="headerlink" title="include"></a>include</h3><p>include动作用于动态地包含另一个资源,它可以包含另一个JSP页面,一个Servlet,一个静态HTML页面。</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"> <span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">title</span>></span>Include Action<span class="tag"></<span class="name">title</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:include</span> <span class="attr">page</span>=<span class="string">"jspf/menu.jsp"</span>/></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:param</span> <span class="attr">name</span>=<span class="string">"text"</span> <span class="attr">value</span>=<span class="string">"How are you?"</span>/></span></span><br><span class="line"> <span class="tag"></<span class="name">jsp:include</span>></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><p>include动作和include指令区别:</p><p>① 使用include指令所引用的东东是发生在页面转换的时候,include动作包含是发生在请求的时候。</p><p>② 使用include指令时,被包含的文件扩展名是什么并不重要,而使用include动作时,文件扩展名必须为jsp,以便它能够作为一个JSP页面进行处理。</p><h3 id="forward"><a href="#forward" class="headerlink" title="forward"></a>forward</h3><p>forward动作是将当前页面跳转到另外一个页面,比如:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">jsp:forward</span> <span class="attr">page</span>=<span class="string">"jspf/login.jsp"</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">jsp:param</span> <span class="attr">name</span>=<span class="string">"text"</span> <span class="attr">value</span>=<span class="string">"Please login"</span>/></span></span><br><span class="line"><span class="tag"></<span class="name">jsp:forward</span>></span></span><br></pre></td></tr></table></figure><p></p><h3 id="错误处理"><a href="#错误处理" class="headerlink" title="错误处理"></a>错误处理</h3><p>在可能发生异常的jsp页面设置异常页面路径:</p><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">errorPage</span>=<span class="string">"errorHandler.jsp"</span>%></span></span><br></pre></td></tr></table></figure><p></p><p>errorHandler.jsp:</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">%@</span> <span class="attr">page</span> <span class="attr">isErrorPage</span>=<span class="string">"true"</span>%></span></span><br><span class="line"><span class="tag"><<span class="name">html</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">head</span>></span><span class="tag"><<span class="name">title</span>></span>Error<span class="tag"></<span class="name">title</span>></span><span class="tag"></<span class="name">head</span>></span></span><br><span class="line"> <span class="tag"><<span class="name">body</span>></span></span><br><span class="line"> An error occurred.<span class="tag"><<span class="name">br</span>/></span></span><br><span class="line"> Error message:</span><br><span class="line"> <span class="tag"><<span class="name">%</span></span></span><br><span class="line"><span class="tag"> <span class="attr">out.println</span>(<span class="attr">exception.toString</span>);</span></span><br><span class="line"><span class="tag"> %></span></span><br><span class="line"> <span class="tag"></<span class="name">body</span>></span></span><br><span class="line"><span class="tag"></<span class="name">html</span>></span></span><br></pre></td></tr></table></figure><p></p><blockquote><p><a href="https://book.douban.com/subject/22994746/" target="_blank" rel="noopener">《Servlet和JSP学习指南》</a>学习笔记</p></blockquote><script>$(".post-body a").not(".thispage").addClass("ignore-href").attr("target","_blank")</script></div><div></div><div><div style="padding:10px 0;margin:20px auto;width:90%;text-align:center;color:#878787" id="reward-div"><div>请作者喝瓶肥宅水🥤</div><button id="rewardButton" style="margin-top:10px" disable="enable" onclick='var e=document.getElementById("QR");"none"===e.style.display?e.style.display="block":e.style.display="none"'><span style="height:46px;width:46px;line-height:46px;border-radius:50%;color:#fe5f55;font-weight:600;background:#ffd5be;border:none;box-shadow:0 4px 8px 0 rgba(255,213,190,.4)">¥</span></button><div id="QR" style="display:none"><div id="wechat" style="display:inline-block"><img id="wechat_qr" src="/img/wechat_pay.png" alt="MrBird WeChat Pay"></div><div id="alipay" style="display:inline-block"><img id="alipay_qr" src="/img/ali_pay.png" alt="MrBird Alipay"></div></div></div><style>#QR img{width:auto;margin:.8em 1em 0 1em}</style></div><div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者:</strong> MrBird</li><li class="post-copyright-link"><strong>本文链接:</strong> <a href="http://mrbird.cc/Java-Server-Pages.html" title="Java Server Pages">http://mrbird.cc/Java-Server-Pages.html</a></li><li class="post-copyright-license"><strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明出处!</li></ul></div><footer class="post-footer"><div class="post-tags" style="margin-bottom:1.3rem"><a href="/tags/servlet-jsp/" rel="tag"># servlet&jsp</a></div><div class="post-nav"><div class="post-nav-next post-nav-item"><a href="/Nexus搭建私服.html" rel="next" title="Nexus搭建私服"><i class="fa fa-chevron-left"></i> Nexus搭建私服</a></div><span class="post-nav-divider"></span><div class="post-nav-prev post-nav-item"><a href="/JSP-Standard-Tag-Library.html" rel="prev" title="JSP Standard Tag Library">JSP Standard Tag Library <i class="fa fa-chevron-right"></i></a></div></div></footer></article><hr><div id="container"></div><div class="post-spread"><div id="comment-div"></div><style>.valine .vlist{margin-bottom:3rem}.valine .vwrap .vcontrol .col.col-60{text-align:left}.valine .vlist .vcard .vhead,.valine .vlist .vcard section .vfooter{text-align:left}.valine .vlist .vcard section{padding-bottom:.5rem!important}.vname{color:#6db33f!important}div#comment-div{margin-bottom:-8rem}.valine .vlist .vcard .vcontent .code,.valine .vlist .vcard .vcontent code,.valine .vlist .vcard .vcontent pre{background:#fbfbfb}.valine .vlist .vcard .vcontent a{color:#6db33f}.valine .vlist .vcard .vimg{border-radius:3px}.valine .vinfo{text-align:left}.valine .vbtn{border-radius:2px;padding:.3rem 1.25rem}.valine .vbtn:active,.valine .vbtn:hover{color:#6db33f;border-color:#6db33f;background-color:#fff}.valine .vwrap .vheader .vinput:focus{border-bottom-color:#6db33f}.valine .vlist .vcard .vcontent.expand:before{background:-webkit-gradient(linear,left top,left bottom,from(hsla(0,0%,100%,0)),to(hsla(0,0%,100%,.2)));background:linear-gradient(180deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.2))}.valine .vlist .vcard .vcontent.expand:after{content:"点击展开";font-size:.4rem;text-align:right;left:-1rem;background:hsla(0,0%,100%,.2)}.valine .vlist .vcard section .vfooter .vat{color:#b3b3b3}.valine .vlist .vcard section .vfooter .vat:hover{color:#6db33f}.vcontent img{margin:0}.valine .info{display:none}</style><script type="text/javascript" src="/js/av.min.js"></script><script type="text/javascript" src="/js/Valine.min.js"></script><script type="text/javascript" src="/js/activate-power-mode.js"></script><script>POWERMODE.colorful=!0,POWERMODE.shake=!1,document.body.addEventListener("input",POWERMODE),new Valine({el:"#comment-div",notify:!1,verify:!0,appId:"SMcDFP1bN1jgb9Lo8JmtICHm-gzGzoHsz",appKey:"dH4nrUrt3V5XiJiI6Qyejnbi",placeholder:"",path:window.location.pathname,avatar:"monsterid",guest_info:["nick","mail","link"]});var chicken='<a href="#"><img src="https://image.uisdc.com/wp-content/uploads/2018/06/uisdc-chat-chicken.gif" class="checken"></a>';$("#comment-div").prepend(chicken)</script></div></div><script>var $bqinline=$("img[alt='bq-inline']");$bqinline.css({width:"2.3rem",height:"2.3rem",display:"inline","vertical-align":"text-bottom"})</script></div><div class="comments" id="comments"></div></div><aside id="sidebar" class="sidebar" onselectstart="return!1"><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">Contents</li><li class="sidebar-nav-overview" data-target="site-overview">Site Preview</li></ul><section class="site-overview sidebar-panel"><div class="sidebar-sticky sticky"><div itemscope itemtype="https://mrbird.cc"><div class="author__header"><div class="author__avatar"><img src="/images/blogImage.jpg" class="author__avatar" alt="MrBird" itemprop="image"></div><div class="author__content"><div class="author__name" itemprop="name">MrBird</div><p class="author__bio" itemprop="description">A simple blog, code repository, just keep blogging</p></div><div class="author__count"><a href="/archives" class="ignore-href"><span class="count">14</span> <span>Archives</span> </a><a href="/tags" class="ignore-href"><span class="count">2</span> <span>Labels</span></a></div></div><div class="author__urls-wrapper"><ul class="author__urls social-icons"><li><a href="/" itemprop="url" class="ignore-href">🏠 Home</a></li><li><a href="/archives" itemprop="url" class="ignore-href">📦 Archives</a></li><li><a href="/tags" itemprop="url" class="ignore-href">🔖 Labels</a></li><li><a href="/friends" itemprop="url" class="ignore-href">👬 Friends</a></li><li><a href="javascript:;" class="popup-trigger animsition-link">🔍 Search</a></li></ul></div></div></div></section><section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"><div class="post-toc"><div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#scriplet"><span class="nav-number">1.</span> <span class="nav-text">scriplet</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#隐式对象"><span class="nav-number">2.</span> <span class="nav-text">隐式对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#指令"><span class="nav-number">3.</span> <span class="nav-text">指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#page指令"><span class="nav-number">3.1.</span> <span class="nav-text">page指令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#include指令"><span class="nav-number">3.2.</span> <span class="nav-text">include指令</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#脚本元素"><span class="nav-number">4.</span> <span class="nav-text">脚本元素</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#表达式"><span class="nav-number">4.1.</span> <span class="nav-text">表达式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#声明"><span class="nav-number">4.2.</span> <span class="nav-text">声明</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#关闭脚本"><span class="nav-number">4.3.</span> <span class="nav-text">关闭脚本</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#动作"><span class="nav-number">5.</span> <span class="nav-text">动作</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#useBean"><span class="nav-number">5.1.</span> <span class="nav-text">useBean</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#存取属性"><span class="nav-number">5.2.</span> <span class="nav-text">存取属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#include"><span class="nav-number">5.3.</span> <span class="nav-text">include</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#forward"><span class="nav-number">5.4.</span> <span class="nav-text">forward</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#错误处理"><span class="nav-number">5.5.</span> <span class="nav-text">错误处理</span></a></li></ol></li></ol></div></div></section></div><div id="asider-footer"><div id="links"><li><a href="https://love.mrbird.cc" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-diamond" aria-hidden="true"></i></a></li><li><a href="https://cloud.mrbird.cn" target="_blank" itemprop="url" class="ignore-href"><i class="fa fa-fw fa-skyatlas" aria-hidden="true"></i></a></li><li><a href="https://gitee.com/mrbirdd" target="_blank" itemprop="sameAs" class="ignore-href"><i class="fa fa-fw fa-codepen" aria-hidden="true"></i></a></li><li><a href="https://github.com/wuyouzhuguli" target="_blank" itemprop="sameAs" class="ignore-href"><i class="fa fa-fw fa-github-alt" aria-hidden="true"></i></a></li></div><div id="author"></div><script type="text/javascript">var $smsheoschzd100dn="@ 2016 - "+(new Date).getFullYear()+" MrBird";document.getElementById("author").innerHTML=$smsheoschzd100dn</script><div><script type="text/javascript" src="/js/busuanzi.js"></script> UV <span class="busuanzi-value" id="busuanzi_value_site_uv" style="cursor:pointer" title="统计开始时间:2019年7月5日"></span> PV <span class="busuanzi-value" id="busuanzi_value_site_pv" style="cursor:pointer" title="统计开始时间:2019年7月5日"></span></div></div><script>function c__(){var o=sidebar_nav_toc.attr("class");o.indexOf("active")!=-1?footer.hide(300):footer.show(300)}var sidebar_nav_toc=$(".sidebar-nav-toc"),footer=$("#asider-footer");c__(),$(".sidebar-nav").on("click",function(){c__()})</script></aside></div></main><div class="back-to-top"><span id="scrollpercent"><span>0</span></span></div></div><script type="text/javascript">"[object Function]"!==Object.prototype.toString.call(window.Promise)&&(window.Promise=null)</script><script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script><script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script><script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script><script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script><script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script><script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script><script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script><script type="text/javascript">function proceedsearch(){$("body").append('<div class="search-popup-overlay local-search-pop-overlay"></div>').css("overflow","hidden"),$(".search-popup-overlay").click(onPopupClose),$(".popup").toggle();var t=$("#local-search-input");t.attr("autocapitalize","none"),t.attr("autocorrect","off"),t.focus()}var isfetched=!1,isXml=!0,search_path="search.xml";0===search_path.length?search_path="search.xml":search_path.endsWith("json")&&(isXml=!1);var path="/"+search_path,onPopupClose=function(t){$(".popup").hide(),$("#local-search-input").val(""),$(".search-result-list").remove(),$("#no-result").remove(),$(".local-search-pop-overlay").remove(),$("body").css("overflow","")},searchFunc=function(t,e,o){"use strict";$("body").append('<div class="search-popup-overlay local-search-pop-overlay"><div id="search-loading-icon"><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i></div></div>').css("overflow","hidden"),$("#search-loading-icon").css("margin","20% auto 0 auto").css("text-align","center"),$.ajax({url:t,dataType:isXml?"xml":"json",async:!0,success:function(t){isfetched=!0,$(".popup").detach().appendTo(".header-inner");var n=isXml?$("entry",t).map(function(){return{title:$("title",this).text(),content:$("content",this).text(),url:$("url",this).text()}}).get():t,r=document.getElementById(e),s=document.getElementById(o),a=function(){var t=r.value.trim().toLowerCase(),e=t.split(/[\s\-]+/);e.length>1&&e.push(t);var o=[];if(t.length>0&&n.forEach(function(n){function r(e,o,n,r){for(var s=r[r.length-1],a=s.position,i=s.word,l=[],h=0;a+i.length<=n&&0!=r.length;){i===t&&h++,l.push({position:a,length:i.length});var p=a+i.length;for(r.pop();0!=r.length&&(s=r[r.length-1],a=s.position,i=s.word,p>a);)r.pop()}return c+=h,{hits:l,start:o,end:n,searchTextCount:h}}function s(t,e){var o="",n=e.start;return e.hits.forEach(function(e){o+=t.substring(n,e.position);var r=e.position+e.length;o+='<b class="search-keyword">'+t.substring(e.position,r)+"</b>",n=r}),o+=t.substring(n,e.end)}var a=!1,i=0,c=0,l=n.title.trim(),h=l.toLowerCase(),p=n.content.trim().replace(/<[^>]+>/g,""),u=p.toLowerCase(),f=decodeURIComponent(n.url),d=[],g=[];if(""!=l&&(e.forEach(function(t){function e(t,e,o){var n=t.length;if(0===n)return[];var r=0,s=[],a=[];for(o||(e=e.toLowerCase(),t=t.toLowerCase());(s=e.indexOf(t,r))>-1;)a.push({position:s,word:t}),r=s+n;return a}d=d.concat(e(t,h,!1)),g=g.concat(e(t,u,!1))}),(d.length>0||g.length>0)&&(a=!0,i=d.length+g.length)),a){[d,g].forEach(function(t){t.sort(function(t,e){return e.position!==t.position?e.position-t.position:t.word.length-e.word.length})});var v=[];0!=d.length&&v.push(r(l,0,l.length,d));for(var C=[];0!=g.length;){var $=g[g.length-1],m=$.position,x=$.word,w=m-20,y=m+80;w<0&&(w=0),y<m+x.length&&(y=m+x.length),y>p.length&&(y=p.length),C.push(r(p,w,y,g))}C.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hits.length!==e.hits.length?e.hits.length-t.hits.length:t.start-e.start});var T=parseInt("1");T>=0&&(C=C.slice(0,T));var b="";b+=0!=v.length?"<li><a href='"+f+"' class='search-result-title'>"+s(l,v[0])+"</a>":"<li><a href='"+f+"' class='search-result-title'>"+l+"</a>",C.forEach(function(t){b+="<a href='"+f+'\'><p class="search-result">'+s(p,t)+"...</p></a>"}),b+="</li>",o.push({item:b,searchTextCount:c,hitCount:i,id:o.length})}}),1===e.length&&""===e[0])s.innerHTML='<div id="no-result"><i class="fa fa-search fa-5x" /></div>';else if(0===o.length)s.innerHTML='<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>';else{o.sort(function(t,e){return t.searchTextCount!==e.searchTextCount?e.searchTextCount-t.searchTextCount:t.hitCount!==e.hitCount?e.hitCount-t.hitCount:e.id-t.id});var a='<ul class="search-result-list">';o.forEach(function(t){a+=t.item}),a+="</ul>",s.innerHTML=a}};r.addEventListener("input",a),$(".local-search-pop-overlay").remove(),$("body").css("overflow",""),proceedsearch()}})};$(".popup-trigger").click(function(t){t.stopPropagation(),isfetched===!1?searchFunc(path,"local-search-input","local-search-result"):proceedsearch()}),$(".popup-btn-close").click(onPopupClose),$(".popup").click(function(t){t.stopPropagation()}),$(document).on("keyup",function(t){var e=27===t.which&&$(".search-popup").is(":visible");e&&onPopupClose()})</script></body><script>$(function(){$("a").not(".nav-link,.cloud-tie-join-count,.ignore-href,.jstree-anchor").addClass("animsition-link")});var burst1=new mojs.Burst({left:0,top:0,radius:{5:40},children:{shape:"circle",fill:["red","cyan","orange"],fillOpacity:.8,radiusX:3.5,radiusY:3.5}});document.addEventListener("click",function(a){null==a.target.href&&"footer"!=a.target.className&&"copyright"!=a.target.className&&"author__urls social-icons"!=a.target.className&&"author__avatar"!=a.target.className&&"sidebar sidebar-active"!=a.target.className&&burst1.tune({x:a.pageX,y:a.pageY}).generate().replay()})</script><script type="text/javascript" src="/js/message.js"></script></html><!-- rebuild by neat -->