⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsprm.htm

📁 网页开速编程学习资料 不能写英文根本无法表达资料内容 抱歉
💻 HTM
📖 第 1 页 / 共 5 页
字号:
</table>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">编译器指引</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">的编译器指引是针对</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">引擎。它们并不会直接产生任何看得见的输出;相反的,它们是在告诉引擎如何处理其它的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">网页。它们永远包含在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt"> 
&lt;%@ ?%&gt;</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">卷标里。两个主要的指引是</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt"> 
page</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">与</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">include</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">。我们不会讨论</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">taglib</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">编译器指引但它可以在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP1.1</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">里用来建立自订卷标。</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">你几乎可以在你所有的</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">网页最上面找到</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:12.0pt">page</span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">编译器指引。虽然这不是必须的,但它可以让你指定到哪里可以找到支持的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">Java</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">类别这类的事:</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;%@ 
page import=&quot;java.util.Date&quot; %&gt;</span><span style="font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">,</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&nbsp;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">当发生</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:12.0pt">Java</span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">问题的事件时应该将讯息传送到哪里:</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;%@ 
page errorPage=&quot;errorPage.jsp&quot; %&gt;</span><span style="font-size:
10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">,</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&nbsp;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">以及你是</span><span lang="EN-US" style="font-size:10.0pt;
mso-bidi-font-size:12.0pt">?</span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">需要为使用者管理通话期的信息,可能存取多个网页</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">(</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">稍后在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JavaBeans</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">里会有更多通话期的讨论</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">):</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;%@ 
page session=&quot;true&quot; %&gt;</span><span style="font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">。</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
12.0pt">&nbsp;include</span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">编译器指引让你将你的内容分成几个可管理的组件,就像那些有表头或脚注的网页。所包含的网页可以是固定格式的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">HTML</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">网页或者是</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">内容的网页</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">:</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;%@ 
include file=&quot;filename.jsp&quot; %&gt;</span><span style="font-size:10.0pt;
mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">。</span></p>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">宣告</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">宣告让你定义网页层的变量,来储存信息或定义支持的函式,让</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">网页的其余部分能够使用。如果你发现自己有太多的程序代码,你最好将它们放在不同的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">Java</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">类别里。你可以在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt"> 
&lt;%! ?%&gt;</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">卷标里找到宣告。记住要在变量宣告的后面加上分号,就跟任何有效的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">Java</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">叙述的形式一样</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">: 
&lt;%! int i=0; %&gt;</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">。</span></p>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">表达式</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">里有表达式,评估表达式的结果可以转换成字符串并且直接使用在输出网页上。</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">运算是属于</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt"> 
&lt;%= ?%&gt; </span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">卷标里,并不包含分号,加引号字符串的无用部分。</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
12.0pt">&lt;%= i %&gt;</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;%= 
&quot;Hello&quot; %&gt; </span><span style="font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">。</span></p>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">程序代码片段</span><span lang="EN-US" style="font-size:13.5pt">/</span><span style="font-size:13.5pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;">小型指令文件</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">JSP</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">程序代码片段或小型指令文件是包含在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;% 
?%&gt; </span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">卷标里。当网络服务器接受这段请求时,这段</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">Java</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">程序代码会执行。小型指令文件可以是原始的</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">HTML</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">或</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">XML</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">,其内部的程序代码片段可以让你建立有条件的执行程序代码,或者只是一些使用另一块程序代码的东西。举例来说,下列的程序代码结合了表达式与小型指令文件,在</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">H1</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">,</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">H2</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">,</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">H3</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">,以及</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">H4</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">卷标里显示字符串</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&quot;Hello&quot;</span><span style="font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;">。小型指令文件不限于一行的原始程序代码</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt"> 
:</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
12.0pt">&lt;% for (int i=1; i&lt;=4; i++) { %&gt;</span><span lang="EN-US"><br>
</span><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:12.0pt">&lt;H&lt;%=i%&gt;&gt;Hello&lt;/H&lt;%=i%&gt;&gt;</span><span lang="EN-US"><br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -