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

📄 jsprm.htm

📁 网页开速编程学习资料 不能写英文根本无法表达资料内容 抱歉
💻 HTM
📖 第 1 页 / 共 5 页
字号:
</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 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 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">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">&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">:</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;mso-bidi-font-size:
12.0pt">&lt;%-- </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"> --%&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"><br>
&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span><span lang="EN-US" style="font-size:18.0pt">JSP</span><span style="font-size:18.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:18.0pt">JavaBean</span><span lang="EN-US"><br>
</span><span style="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">Java</span><span style="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">JavaBean</span><span style="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">JavaBean</span><span style="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">ActiveX</span><span style="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">:</span><span style="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">JavaBean</span><span style="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">JavaBean</span><span style="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">JavaBean</span><span style="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">JSP</span><span style="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">'JavaBean'</span><span style="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-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">假设</span><span lang="EN-US">JavaBean</span><span style="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">JSP</span><span style="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">JavaBean.</span><span style="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="color:#006600">&lt;jsp:useBean&gt;</span><span style="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 style="color:#006600">&lt;jsp:useBean id=&quot;localName&quot; 
class=&quot;com.jguru.Person&quot; scope=&quot;application&quot; /&gt;</span>.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#006600">&lt;jsp:useBean&gt;</span><span style="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="color:#006600">id</span><span lang="EN-US"> 
</span><span style="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">.</span><span style="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">JSP</span><span style="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="color:#006600">id</span><span lang="EN-US"> 
</span><span style="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">Java</span><span style="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="color:#006600">scope</span><span lang="EN-US"> 
</span><span style="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">.</span><span style="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">(</span><span style="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">)[scope=&quot;page&quot;]</span><span style="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">[scope=&quot;request&quot;]</span><span style="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">[scope=&quot;session&quot;]</span><span style="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">[scope=&quot;application&quot;]</span><span style="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">.</span><span style="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">JSP</span><span style="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-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;
mso-hansi-font-family:&quot;Times New Roman&quot;">一但你宣告了</span><span lang="EN-US">JavaBean</span><span style="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="color:#006600">&lt;jsp:getProperty&gt;</span><span style="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="color:#006600">&lt;jsp:getProperty&gt;</span><span style="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">(</span><span style="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">useBean</span><span style="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">id</span><span style="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">)</span><span style="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 style="color:#006600">&lt;jsp:getProperty id=&quot;localName&quot; 
property=&quot;name&quot; /&gt;</span>.</span></p>
<p class="MsoNormal"><span style="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">JavaBean</span><span style="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="color:#006600">&lt;jsp:setProperty&gt;</span><span style="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">.</span><span style="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">.</span><span style="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 style="color:#006600">&lt;jsp:setProperty id=&quot;localName&quot; 
property=&quot;*&quot; /&gt;</span>;&nbsp;</span></p>
<p class="MsoNormal"><span style="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 style="color:#006600">&lt;jsp:setProperty id=&quot;localName&quot; 
property=&quot;address&quot; param=&quot;parameterName&quot; /&gt;</span>;&nbsp;</span></p>
<p class="MsoNormal"><span style="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 style="color:#006600">&lt;jsp:setProperty id=&quot;localName&quot; 
property=&quot;serialNumber&quot; value=&quot;string&quot; /&gt;</span> or <span style="color:#006600">&lt;jsp:setProperty 
id=&quot;localName&quot; property=&quot;serialNumber&quot; value= &lt;%= 
expression %&gt; /&gt;</span>.</span></p>
<p class="MsoNormal"><span style="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">JavaBean</span><span style="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">:</span><span style="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">JavaBean</span><span style="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">JSWDK</span><span style="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"> 
\jswdk-1.0.1\classes.<br>
&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;<

⌨️ 快捷键说明

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