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

📄 ws-j2x-2-4.html

📁 javascript流程设计器,主要可以实现拖拽图形
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</tr>
<tr valign="top">
<td class="small" colspan="6"><a target="_blank" style="color: #ffffff;" href="http://202.95.2.149/help.htm">高级搜索</a><img alt="" height="1" width="1" border="0" src="../i/c.gif"></td>
</tr>
<tr>
<td colspan="6"><img alt="" height="4" width="390" border="0" src="../i/c.gif"></td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td class="hbg" height="21" width="160"></td><td class="bbg" valign="top" height="21" colspan="2">  <a href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/" class="mainlink">IBM 主页</a><span class="divider"> | </span><a href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/products/index.shtml" class="mainlink">产品与服务</a><span class="divider"> | </span><a href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/support/index.shtml" class="mainlink">支持与下载</a><span class="divider"> | </span><a href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/account/index.shtml" class="mainlink">个性化服务</a></td>
</tr>
</table>
<TABLE width="100%" cellspacing="0" cellpadding="0" border="0">
<TR>
<TD bgcolor="#ffffff" height="1" width="150"><IMG src="../i/c.gif" width="150" height="1"></TD>
</TR>
<TR>
<TD bgcolor="#cc6633" height="3" width="150"><IMG src="../i/c.gif" width="150" height="3"></TD>
</TR>
<TR>
<TD bgcolor="#333333" height="1" width="150"><IMG src="../i/c.gif" width="150" height="1"></TD>
</TR>
<TR>
<TD bgcolor="#000000" height="1" width="150"><IMG src="../i/c.gif" width="150" height="1"></TD>
</TR>
<TR>
<TD bgcolor="#ffffff" height="1" width="150"><IMG src="../i/c.gif" width="150" height="2"></TD>
</TR>
</TABLE>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><font size="-1" face="Verdana, sans-serif"><a href="http://www.ibm.com/">IBM</a> : <a href="/developerWorks/cn/index.shtml">developerWorks 中国网站</a> : <a href="/developerWorks/cn/xml/index.shtml">xml</a> : <a href="/developerWorks/cn/cnedu.nsf/xml-onlinecourse-bytitle">教学 - 在线教程</a></font>
<br>
<img alt="用 XDoclet 来改进 J2EE 组件的重用" src="imagemaster/masthead.jpg"></td><td width="*" valign="bottom" align="right"><a border="0" href="ws-j2x.zip"><img alt="下载 ZIP 文件" border="0" src="../i/icon-zip.gif"></a><a target="_blank" href="../tutorial_eng/index.html" border="0"><img alt="英文原文" border="0" src="../i/icon-source.gif"></a>
					
					
					
&nbsp;&nbsp;&nbsp;
				</td>
</tr>
<tr>
<td height="2" colspan="2"><img height="2" width="1" src="../i/c.gif"></td>
</tr>
</table>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD width="150" height="1" bgcolor="#000000" colspan="6"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD>
</TR>
<TR>
<TD background="../i/sw-gold.gif"><a border="0" href="index.html" onMouseOver="iOver('topmain'); iOver('bottommain'); self.status=mainblurb; return true;" onMouseOut="iOut('topmain'); iOut('bottommain'); self.status=''; return true;"><img alt="主菜单" border="0" src="../i/main.gif" name="topmain"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topsection'); iOver('bottomsection'); self.status=sectionblurb; return true;" onMouseOut="iOut('topsection'); iOut('bottomsection'); self.status=''; return true;" href="index2.html"><img alt="章节菜单" border="0" src="../i/section.gif" name="topsection"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topfeedback'); iOver('bottomfeedback'); self.status=feedbackblurb; return true;" onMouseOut="iOut('topfeedback'); iOut('bottomfeedback'); self.status=''; return true;" href="ws-j2x-6-3.html"><img alt="给出此教程的反馈意见" border="0" src="../i/feedback.gif" name="topfeedback"></a></TD><TD width="100%" background="../i/sw-gold.gif"><img src="../i/c.gif"></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topprevious'); iOver('bottomprevious'); self.status=previousblurb; return true;" onMouseOut="iOut('topprevious'); iOut('bottomprevious'); self.status=''; return true;" href="ws-j2x-2-3.html"><img alt="上页" border="0" src="../i/previous.gif" name="topprevious"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topnext'); iOver('bottomnext'); self.status=nextblurb; return true;" onMouseOut="iOut('topnext'); iOut('bottomnext'); self.status=''; return true;" href="ws-j2x-2-5.html"><img alt="下页" border="0" src="../i/next.gif" name="topnext"></a></TD>
</TR>
</TABLE>
<table bgcolor="ffffff" cellspacing="0" cellpadding="2" border="0" height="400" width="100%">
<tr valign="bottom">
<a name="navskip"></a><td height="25" colspan="4"><img alt="2.循序渐进的 Servlet 示例" src="imagemaster/titlebar2.jpg" border="0" height="25" width="562"></td>
</tr>
<tr>
<td bgcolor="ffffff" width="15">&nbsp;</td><td bgcolor="ffffff" width="12">&nbsp;</td><td valign="top" align="left" bgcolor="ffffff" width="*">
<p>
<br>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="90%"><font size="4" face="Verdana, Arial, Helvetica"><b>第三步:综合应用 Ant 和 XDoclet 来配置组件</b></font></td><td width="200" align="right"><font size="1" face="Verdana, Arial, Helvetica"><nobr>   第 4 页(共14 页)</nobr></font></td>
</tr>
</table>
<br>
<br>
</p>
<font size="2" face="Verdana, Arial, Helvetica">
<p>您一般<i>不</i>愿把初始化参数硬编码到源代码中。有关使用 <code>&lt;init-param&gt;</code> 的全部概念是使 Web 组件可被应用程序组装器(application assembler)定制为 J2EE 应用程序。</p>
<p>更好的方法是把初始参数设为指向类似 @bye@ 和 @hi@ 中的标记,然后使用启用了过滤的 Ant 复制来为正确的应用程序传递正确的标记值。这里假定您使用 Ant 来构建项目。</p>
<p>您可以使用 Ant 过滤来把配置文件中的标记替换成它们在部署环境中的正确的值。过滤器是支持配置多个应用程序的 J2EE 组件的另一种方式。以下是根据条件来配置 <i>web.xml</i> 的示例 Ant 脚本:
 <pre>
<code style="font-family: Courier New, Courier, monospace; font-size: 12">
 &lt;project name="filtering" default="run"&gt;
 
   &lt;target name="spanishSetup" if="spanish"&gt;
         &lt;filter token="bye" value="adios"/&gt;
         &lt;filter token="hi" value="hola"/&gt;
   &lt;/target&gt;
 
   &lt;target name="englishSetup" unless="spanish"&gt;
         &lt;filter token="bye" value="goodbye"/&gt;
          &lt;filter token="hi" value="hello"/&gt;
   &lt;/target&gt;
 
   &lt;target name="setup" depends="spanishSetup,englishSetup"/&gt;
 
   &lt;target name="run" depends="setup"&gt;
         &lt;copy todir="${workspace}/WEB-INF" filtering="true"&gt;
               &lt;fileset dir="./WEB-INF"/&gt;
         &lt;/copy&gt;
   &lt;/target&gt;  
 &lt;/project&gt;
 
 </code>
</pre>

在上面的 Ant 示例中,<code>englishSetup</code> 目标中的过滤器把 bye 标记设为 <i>goodbye</i>,而 <code>spanishSetup</code> 目标中的过滤器把 bye 标记设为 <i>adios</i>。</p>
<p>稍后,当脚本使用启用了过滤的复制任务时,它把过滤器应用于复制任务指定的文件集中的所有的文件。若 <i>spanish</i> 属性被设置,则启用了过滤的复制任务把所有的字符串 @bye@ 替换为 <i>adios</i>,若 <i>spanish</i> 属性没有被设置,则 <i>goodbye</i>。</p>
<p>
						
<b>更容易的方法&hellip;&hellip;</b>
<br>
虽然这是解决这个问题的一个方法,但是还有更容易的方法。Ant 属性可被用来设置 XDoclet 中的每个属性值。因为您用 XDoclet Ant 任务来生成相关的文件,所以 XDoclet 可访问所有的 ant 属性。因此,您可以这样来设置值:

 <pre>
<code style="font-family: Courier New, Courier, monospace; font-size: 12">
 ...
 * @web.servlet-init-param     name="hi" 
  *                     value="${basic.servlet.hi}"
  * 
  * @web.servlet-init-param     name="bye" 
  *                     value="${basic.servlet.bye}"
 ...
 */
 public class BasicServlet extends HttpServlet {
 
 </code>
</pre>
然后,当您生成 <i>web.xml</i> 文件时,<code>hi</code> 和 <code>bye</code> 初始化参数被设置成 Ant 构建脚本中设置的 <code>basic.servlet.hi</code> 和 <code>basic.servlet.bye</code> 属性的当前值。XDoclet 和 Ant 相互配合从而使 J2EE 组件被配置成应用程序。主要的好处是可按每个应用程序来配置组件。想象一下每个应用程序的主构建文件,这个文件调用每个组件的构建文件,把配置某个应用程序的组件所需的信息传递给构建文件。</p>
<br>
</font></td>
</tr>
</table>
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
<TR>
<TD background="../i/sw-gold.gif"><a border="0" href="index.html" onMouseOver="iOver('topmain'); iOver('bottommain'); self.status=mainblurb; return true;" onMouseOut="iOut('topmain'); iOut('bottommain'); self.status=''; return true;"><img alt="主菜单" border="0" src="../i/main.gif" name="bottommain"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topsection'); iOver('bottomsection'); self.status=sectionblurb; return true;" onMouseOut="iOut('topsection'); iOut('bottomsection'); self.status=''; return true;" href="index2.html"><img alt="章节菜单" border="0" src="../i/section.gif" name="bottomsection"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topfeedback'); iOver('bottomfeedback'); self.status=feedbackblurb; return true;" onMouseOut="iOut('topfeedback'); iOut('bottomfeedback'); self.status=''; return true;" href="ws-j2x-6-3.html"><img alt="给出此教程的反馈意见" border="0" src="../i/feedback.gif" name="bottomfeedback"></a></TD><TD width="100%" background="../i/sw-gold.gif"><img src="../i/c.gif"></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topprevious'); iOver('bottomprevious'); self.status=previousblurb; return true;" onMouseOut="iOut('topprevious'); iOut('bottomprevious'); self.status=''; return true;" href="ws-j2x-2-3.html"><img alt="上页" border="0" src="../i/previous.gif" name="bottomprevious"></a></TD><TD background="../i/sw-gold.gif"><a border="0" onMouseOver="iOver('topnext'); iOver('bottomnext'); self.status=nextblurb; return true;" onMouseOut="iOut('topnext'); iOut('bottomnext'); self.status=''; return true;" href="ws-j2x-2-5.html"><img alt="下页" border="0" src="../i/next.gif" name="bottomnext"></a></TD>
</TR>
<TR>
<TD width="150" height="1" bgcolor="#000000" colspan="6"><IMG alt="" height="1" width="150" src="../i/c.gif"></TD>
</TR>
</TABLE>
<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">
<TR>
<TD width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><img alt="" height="1" width="1" src="../i/c.gif"></td>
</tr>
<tr valign="top">
<td class="bbg" height="21"> <a class="mainlink" href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/ibm/index.shtml">关于 IBM</a><span class="divider"> | </span><a class="mainlink" href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/ibm/privacy/index.shtml">隐私条约</a><span class="divider"> | </span><a class="mainlink" href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/ibm/legal/index.shtml">法律条款</a><span class="divider"> | </span><a class="mainlink" href="/developerWorks/cgi-bin/click.cgi?url=http://www-900.ibm.com/cn/ibm/contact/index.shtml">联系 IBM</a></td>
</tr>
</table>
</TD>
</TR>
</TABLE>
<script src="//www.ibm.com/common/stats/stats.js" language="JavaScript1.2" type="text/javascript"></script>
<noscript>
<img border="0" alt="" height="1" width="1" src="//stats.www.ibm.com/rc/images/uc.GIF?R=noscript"></noscript>
</body>
</html>

⌨️ 快捷键说明

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