2019-12-13

會話(session)

會話他是一個作用域锰什,可以存值,可以取值玉工,session的id一樣羽资,就是同一個會話,不一樣遵班,就不是同一個會話

實現(xiàn)session有兩種形式

cookies(默認)

cookie被禁用屠升,url重寫

當cookie被禁用,session不好使了,在提交的后面加一個狭郑;jsessionid=session.getid

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n128" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//獲取session</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">HttpSession session = request.getSession();</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n129" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.isNew()</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">返回值true,false,判斷這個session是不是新的會話</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n130" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//session設置會話有效時間</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.setMaxInactiveInterval(60*60);</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n131" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//會話最后訪問時間</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.getLastAccessedTime()</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n132" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//會話創(chuàng)建時間</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.getCreationTime()</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n133" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//獲取會話有效時間</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.getMaxInactiveInterval()</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n134" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//獲取Id</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.getId()</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n135" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//添加腹暖,第二個值是object類型</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.setAttribute("count",count);</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n136" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//獲取 返回值object</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">session.getAttribute("count")</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

</pre>

servlet2.5,3.0區(qū)別

2.5要在web.xml中配置,3.0不用翰萨,但得寫注解脏答,2.5配置文件會越來越多

jsp

servlet缺點:寫html代碼費勁,寫java代碼方便(java代碼里嵌入html)

jsp:就是一個servlet,是servlet升級版殖告,寫html方便(html里嵌入java代碼)

嵌入java代碼用<% %>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n151" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><%</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> Date time=new Date();</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">out.print("<h3>time:"+time+"<h3>");</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">%></pre>

</pre>

當你第一次使用jsp時糙麦,速度略微慢點

jsp編譯過程:先編譯成servlet,在編譯成.class文件丛肮,在運行在虛擬機上.

jsp注釋:

使用“//”對單行代碼進行注釋

使用“/* */”方式對多行代碼進行注釋

使用“/** */”方式對多行代碼進行注釋

使用“<%-- --%>”對多行代碼進行注釋(客戶端不能查看到 )

使用“”對多行HTML代碼進行注釋這(客戶端可以查看到)

指令

page指令:

include指令

include 指令用于在運行時將 HTML文件或 JSP頁面嵌入到另一個 JSP頁面 "

<%@ include file = "/foot.jsp" %>

聲明的概念

JSP聲明就是在JSP頁面中聲明Java方法

1:<%!public int x=10;%>(聲明標記:聲明一個屬性,方法赡磅,以后不用,用了就錯了)

2:標記:書寫java代碼的地方

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n185" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><% </pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">String name="哈哈";</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">int count=100;</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">%></pre>

</pre>

3:輸出標記

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n188" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h1>輸出標記:</h1></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>name:<%=name %></h3></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>count:<%=count+10 %></h3></pre>

</pre>

jsp隱式對象

request

也是一個域宝与,可以傳值到jsp

request.setAttribute()

第一個參數(shù)字符串焚廊,第二個object類型

request.getAttribute()

參數(shù)是字符串,返回值是object類型

request.getContextPath()工程目錄

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n205" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><%=request.getContextPath() %>/index.jsp</pre>

</pre>

2種跳轉(zhuǎn)頁面方法习劫,第二種request值可以傳過去this.findAll(request, response);

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n209" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//跳轉(zhuǎn)url地址欄不是最終地址咆瘟,是servlet地址,可以把request作用域里面的值傳過去</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">request.getRequestDispatcher("MessageServlet?method=findAll").forward(request, response);</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//地址欄是最終地址欄诽里,request作用域里的值傳不過去袒餐,還可以跳站外資源(例如百度)</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">response.sendRedirect("MessageServlet?method=findAll");</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//第二種跳轉(zhuǎn)鏈接可以傳值,第二個頁面可以拿到谤狡。</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//跳servlet時灸眼,不一定調(diào)用dopost,還是doget,看根源處走的是什么</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">?</pre>

</pre>

隱式對象

輸入輸出:request 墓懂,response,out

作用域通信:session,application,PageContext

Servlet對象:page(Object類型對象)config(配置文件信息)

錯誤對象:exception

application:作用于整個應用服務器的全局作用域

request:出了這個請求響應就不能用

session:不是一個ID就不能用

pageContext:當前頁面作用域

錯誤

04(路徑錯誤)

500(代碼錯誤)

401(驗證錯誤)

405(doPost/doGet方法不全)

編寫顯示錯誤的頁面

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n241" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//在web.xml文件中配置焰宣,寫jsp錯誤頁面,location里面是jsp文件路徑</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><error-page></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> <error-code>404</error-code></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> <location>/error404.jsp</location></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> </error-page></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> <error-page></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> <error-code>500</error-code></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> <location>/error500.jsp</location></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"> </error-page></pre>

</pre>

Jsp El

1.減少JSP頁面中Java代碼

2.方便JSP中代碼的修改捕仔,也方便美工修改頁面外觀

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n250" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>10+10=<%=10+10 %></h3></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>10+10=${10+10 }</h3></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">效果差不多</pre>

</pre>

<pre class="md-fences md-end-block" lang="" contenteditable="false" cid="n251" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">

<textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="box-sizing: border-box; overflow: auto; color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; margin: 0px; position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>name=<%=x %></h3> //x是get取到的</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>name2=${name }</h3>//前面的set方法第一個參數(shù)叫name</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;">//u是set的第一個參數(shù)匕积,第二個參數(shù)是u這個對象,el表達式可以支架用第一個參數(shù)點出對象中的屬性</pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>username:${u.username }</h3></pre>

<pre class=" CodeMirror-line " role="presentation" style="box-sizing: border-box; overflow: visible; font-family: inherit; font-size: inherit; white-space: pre-wrap; line-height: 1.71429em; break-inside: avoid; padding: 0px 4px; border-radius: 0px; border-top-width: 0px; border-right: none; border-bottom-width: 0px; border-left-width: 0px; background: 0px 0px; margin: 0px; word-wrap: break-word; color: inherit; z-index: 2; position: relative; word-break: normal; width: inherit;"><h3>pwd:${u.pwd }</h3></pre>

</pre>

[圖片上傳失敗...(image-a1653d-1576216451512)]

JSP EL的內(nèi)置對象

requestScope

sessionScope

applicationScope

param

paramValues

el表達式讀取順序

page-request-session-application

當四個域的set方法存的第一個參數(shù)一樣時榜跌,有固定的讀取順序

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n271" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">//內(nèi)置對象的用法闪唆,固定讀取
<h3>name:{requestScope.name};</h3> <h3>name:{sessionScope.name};</h3>
<h3>name:${applicationScope.name};</h3>
</pre>

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n272" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 0px; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">//同request.getParmeter("name")
<h3>name4:${param.name};</h3>
</pre>

MVC

是一種編程的思想,包括M V C ,m:數(shù)據(jù)模型钓葫。V:顯示層 C:控制層悄蕾,能使各層都分開,便于我們?nèi)粘5姆止ず献魅勘疲茉黾右稽c代碼的復雜度

定制標記庫

增加表現(xiàn)層的處理能力

減少JSP文件中的Java代碼

定制標記的作用類似

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n285" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">//導入標記庫
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
</pre>

1.set標簽笼吟,可以向不同的作用域里傳值

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n290" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><c:set var="name2" scope="session" value="session里面的值"></c:set>
</pre>

2.放在catch標簽里,即使錯誤霸旗,程序也能繼續(xù)運行

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n293" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><c:catch var="e">
<%
int p=Integer.parseInt(request.getParameter("page")) ;

%>
<h3>page=<%=p %></h3>

</c:catch>
//錯誤信息
<h3>e=${e}</h3>
</pre>

3.if標簽贷帮,跟if語句一樣,沒有else

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n296" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><c:if test="{empty name3 }"> <h3>name3里面為空</h3> </c:if> <c:if test="{ not empty name3 }">
<h3>name3里面不為空name3=${name3}</h3>

</c:if>
</pre>

4.choose標簽,和when標簽一起使用诱告,相當于else if,otherwide標簽相當于else

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n299" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><c:choose>
<c:when test="{param.p<10 }"> <h3>p小于10</h3> </c:when> <c:when test="{param.p<50 }">
<h3>p小于50</h3>
</c:when>
<c:otherwise>

<h3>p不小于50</h3>
</c:otherwise>
</c:choose>
</pre>

5循環(huán).標簽撵枢,從1開始,沒回走2,走到10

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n302" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><c:forEach begin="1" end="10" var="i" step="2" varStatus="s">
i={i }==>{s.count }

</c:forEach>
</pre>

6.forTokens標簽,以逗號分割

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n305" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 0px; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><%
request.setAttribute("aihao", "吃,喝,玩,樂");
%>
<c:forTokens items="{aihao }" delims="," var="a" varStatus="s">{s.index}==>${a }

</c:forTokens>
</pre>

Servlet監(jiān)聽器

在Web應用中響應特定對象的特定事件

1.更加方便的控制application锄禽、session 和request 對象的發(fā)生的特定事件潜必。

2.可以集中處理特定的事件。

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n314" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"> session.invalidate();
//關閉session
</pre>

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n315" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">//當前頁面有session沃但,就用當前session磁滚,沒有也不創(chuàng)建session
<%@page session="false" %>
</pre>

servlet監(jiān)聽器創(chuàng)建過程

需要配置web.xml文件

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n320" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><listener>
<listener-class>com.neusoft.listener.CountListener</listener-class>
</listener>
</pre>

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n321" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">package com.neusoft.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class CountListener implements HttpSessionListener {
public static int count=0;

@Override
public void sessionCreated(HttpSessionEvent arg0) {
// TODO Auto-generated method stub

  count++;
  System.out.println("創(chuàng)建 count="+count);

}

@Override
public void sessionDestroyed(HttpSessionEvent arg0) {
// TODO Auto-generated method stu
count--;
System.out.println("銷毀 count="+count);

}

}

</pre>

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n322" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">package com.neusoft.listener;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

public class MyListener implements HttpSessionAttributeListener {

@Override
public void attributeAdded(HttpSessionBindingEvent arg0) {
System.out.println("添加");

}

@Override
public void attributeRemoved(HttpSessionBindingEvent arg0) {
System.out.println("移除");

}

@Override
public void attributeReplaced(HttpSessionBindingEvent arg0) {
System.out.println("替換");

}

}

</pre>

Servlet過濾器

Filter接口,需要實現(xiàn)這個接口宵晚,有初始化垂攘,執(zhí)行,銷毀3個方法

初始化:在啟動服務時調(diào)用

執(zhí)行:在進入另一個窗口時調(diào)用

銷毀:在關閉服務式調(diào)用

需要配置web.xml文件

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n337" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;"><filter>
<filter-name>正常寫文件名</filter-name>
<filter-class>cm.neusoft.filter.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>正常寫文件名</filter-name>
<url-pattern>/</url-pattern>
// /
代表所有都過濾,即使地址寫錯了淤刃,或者沒有這個地址晒他,也都會過濾
</filter-mapping>
</pre>

<pre class="md-fences mock-cm md-end-block" lang="" contenteditable="false" cid="n338" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9rem; white-space: pre-wrap; line-height: 1.71429em; text-align: left; break-inside: avoid; display: block; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(218, 218, 218); position: relative !important; margin-bottom: 3em; padding-left: 1ch; padding-right: 1ch; margin-left: 2em; width: inherit;">package cm.neusoft.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class MyFilter implements Filter{

@Override
public void destroy() {
System.out.println("銷毀");

}

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
System.out.println("執(zhí)行");
/*

  • 如果有下一個filter,執(zhí)行下一個filter
  • 如果沒有下一個filter,執(zhí)行原請求
    */
    chain.doFilter(request, response);
    }

@Override
public void init(FilterConfig arg0) throws ServletException {
System.out.println("初始化");

}

}

</pre>

由一個jsp跳到一個servlet,然后這個servlet以.forward跳到另一個jsp或者servlet里面逸贾,下一個jsp或者servlet不會被攔截(不會被過濾)陨仅。

當跳轉(zhuǎn)的時候,以sendRedirect進行跳轉(zhuǎn)的時候铝侵,無腦被過濾灼伤,以.forward跳轉(zhuǎn)的時候,跳轉(zhuǎn)的界面不會被過濾

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末哟沫,一起剝皮案震驚了整個濱河市饺蔑,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌嗜诀,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,123評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件孔祸,死亡現(xiàn)場離奇詭異隆敢,居然都是意外死亡,警方通過查閱死者的電腦和手機崔慧,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,031評論 2 384
  • 文/潘曉璐 我一進店門拂蝎,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人惶室,你說我怎么就攤上這事温自。” “怎么了皇钞?”我有些...
    開封第一講書人閱讀 156,723評論 0 345
  • 文/不壞的土叔 我叫張陵悼泌,是天一觀的道長。 經(jīng)常有香客問我夹界,道長馆里,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,357評論 1 283
  • 正文 為了忘掉前任,我火速辦了婚禮鸠踪,結(jié)果婚禮上丙者,老公的妹妹穿的比我還像新娘。我一直安慰自己营密,他們只是感情好械媒,可當我...
    茶點故事閱讀 65,412評論 5 384
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪缀匕。 梳的紋絲不亂的頭發(fā)上客蹋,一...
    開封第一講書人閱讀 49,760評論 1 289
  • 那天,我揣著相機與錄音牺弄,去河邊找鬼。 笑死,一個胖子當著我的面吹牛缀辩,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播踪央,決...
    沈念sama閱讀 38,904評論 3 405
  • 文/蒼蘭香墨 我猛地睜開眼臀玄,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了畅蹂?” 一聲冷哼從身側(cè)響起健无,我...
    開封第一講書人閱讀 37,672評論 0 266
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎液斜,沒想到半個月后累贤,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 44,118評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡少漆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,456評論 2 325
  • 正文 我和宋清朗相戀三年臼膏,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片示损。...
    茶點故事閱讀 38,599評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡渗磅,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出检访,到底是詐尸還是另有隱情始鱼,我是刑警寧澤,帶...
    沈念sama閱讀 34,264評論 4 328
  • 正文 年R本政府宣布脆贵,位于F島的核電站医清,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏丹禀。R本人自食惡果不足惜状勤,卻給世界環(huán)境...
    茶點故事閱讀 39,857評論 3 312
  • 文/蒙蒙 一鞋怀、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧持搜,春花似錦密似、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,731評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至贫导,卻和暖如春抛猫,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背孩灯。 一陣腳步聲響...
    開封第一講書人閱讀 31,956評論 1 264
  • 我被黑心中介騙來泰國打工闺金, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人峰档。 一個月前我還...
    沈念sama閱讀 46,286評論 2 360
  • 正文 我出身青樓败匹,卻偏偏與公主長得像,于是被迫代替她去往敵國和親讥巡。 傳聞我的和親對象是個殘疾皇子掀亩,可洞房花燭夜當晚...
    茶點故事閱讀 43,465評論 2 348

推薦閱讀更多精彩內(nèi)容

  • JSP總結(jié)(經(jīng)典) day1 JSP 定義: 1)Java Server Page, Java EE 組件,本...
    java日記閱讀 3,421評論 0 13
  • 一. Java基礎部分.................................................
    wy_sure閱讀 3,805評論 0 11
  • 本文包括:1欢顷、Listener簡介2槽棍、Servlet監(jiān)聽器3、監(jiān)聽三個域?qū)ο髣?chuàng)建和銷毀的事件監(jiān)聽器4抬驴、監(jiān)聽三個域?qū)?..
    廖少少閱讀 6,033評論 6 28
  • 監(jiān)聽器(listener) 監(jiān)聽器簡介 :監(jiān)聽器就是一個實現(xiàn)特定接口的普通java程序炼七,這個程序?qū)iT用于監(jiān)聽另一個...
    奮斗的老王閱讀 2,498評論 0 53
  • 這部分主要是與Java Web和Web Service相關的面試題。 96怎爵、闡述Servlet和CGI的區(qū)別? 答...
    雜貨鋪老板閱讀 1,400評論 0 10