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

📄 jspx2.html

📁 j2eePDF格式的电子书
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    <td><a name="wp121474"> </a><div class="pCellBody"><code class="cCode">/bookreceipt</code></div></td></tr>  <tr align="left">    <td><a name="wp121464"> </a><div class="pCellBody"><code class="cCode">bookshowcart</code></div></td>    <td><a name="wp121466"> </a><div class="pCellBody"><code class="cCode">bookshowcart.jsp</code></div></td>    <td><a name="wp121468"> </a><div class="pCellBody"><code class="cCode">/bookshowcart</code></div></td></tr>  <tr align="left">    <td><a name="wp117169"> </a><div class="pCellBody"><code class="cCode">bookstore</code></div></td>    <td><a name="wp117171"> </a><div class="pCellBody"><code class="cCode">bookstore.jsp</code></div></td>    <td><a name="wp117173"> </a><div class="pCellBody"><code class="cCode">/bookstore</code></div></td></tr></table></div></li></div></ol></div><a name="wp117218"> </a><div class="pSmartList1"><li>Add the JSTL resource bundle basename context parameter.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117266"> </a><div class="pSmartList2"><li>Select the <code class="cCode">bookstore5</code> WAR file from the tree.</li></div><a name="wp117450"> </a><div class="pSmartList2"><li>Select the Context tab. </li></div><a name="wp117219"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp117220"> </a><div class="pSmartList2"><li>Enter <code class="cCode">javax.servlet.jsp.jstl.fmt.localizationContext</code> for the Coded Parameter.</li></div><a name="wp117221"> </a><div class="pSmartList2"><li>Enter <code class="cCode">messages.BookstoreMessages</code> for the Value.</li></div></ol></div><a name="wp117222"> </a><div class="pSmartList1"><li>Add the context path to the XML stream.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117452"> </a><div class="pSmartList2"><li>While on the Context tab, click Add again.</li></div><a name="wp117456"> </a><div class="pSmartList2"><li>Enter <code class="cCode">booksURL</code> for the Coded Parameter.</li></div><a name="wp117457"> </a><div class="pSmartList2"><li>Enter <code class="cCode">http://localhost:8080/books/books.jspx</code> for the Value.</li></div></ol></div><a name="wp117451"> </a><div class="pSmartList1"><li>Set prelude and codas for all JSP pages.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117223"> </a><div class="pSmartList2"><li>Select the JSP Properties tab.</li></div><a name="wp117224"> </a><div class="pSmartList2"><li>Click the Add button next to the Name list.</li></div><a name="wp117225"> </a><div class="pSmartList2"><li>Enter <code class="cCode">bookstore5</code>.</li></div><a name="wp117226"> </a><div class="pSmartList2"><li>Click the Add URL button next to the URL Pattern list.</li></div><a name="wp117227"> </a><div class="pSmartList2"><li>Enter <code class="cCode">*.jsp</code>.</li></div><a name="wp117228"> </a><div class="pSmartList2"><li>Click the Edit Preludes button next to the Include Preludes list.</li></div><a name="wp117229"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp117230"> </a><div class="pSmartList2"><li>Enter <code class="cCode">/template/prelude.jspf</code>.</li></div><a name="wp117231"> </a><div class="pSmartList2"><li>Click OK.</li></div><a name="wp117232"> </a><div class="pSmartList2"><li>Click the Edit Codas button next to the Include Codas list.</li></div><a name="wp117233"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp117234"> </a><div class="pSmartList2"><li>Enter <code class="cCode">/template/coda.jspf</code>.</li></div><a name="wp117235"> </a><div class="pSmartList2"><li>Click OK.</li></div></ol></div><a name="wp117245"> </a><div class="pSmartList1"><li>Select File<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Save.</li></div><a name="wp117246"> </a><div class="pSmartList1"><li>Deploy the application. </li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117247"> </a><div class="pSmartList2"><li>Select Tools<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Deploy. </li></div><a name="wp117248"> </a><div class="pSmartList2"><li>Click OK.</li></div><a name="wp117249"> </a><div class="pSmartList2"><li>A popup dialog will display the results of the deployment. Click Close.</li></div></ol></div><a name="wp117307"> </a><div class="pSmartList1"><li>Create a Web application called <code class="cCode">books</code> by running the New Web Component Wizard. Select File<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>New<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Web Component.</li></div><a name="wp117308"> </a><div class="pSmartList1"><li>New Web Component Wizard</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117309"> </a><div class="pSmartList2"><li>Click Next in the Introduction screen</li></div><a name="wp121606"> </a><div class="pSmartList2"><li>In the WAR File screen, select the Create New Stand-Alone WAR Module radio button.</li></div><a name="wp117310"> </a><div class="pSmartList2"><li>Click Browse and in the file chooser, navigate to <code class="cCode">&lt;</code><code class="cVariable">INSTALL</code><code class="cCode">&gt;/j2eetutorial14/examples/web/bookstore5/</code>. </li></div><a name="wp117311"> </a><div class="pSmartList2"><li>In the File Name field, enter <code class="cCode">books</code>.</li></div><a name="wp117312"> </a><div class="pSmartList2"><li>Click Choose Module File.</li></div><a name="wp117313"> </a><div class="pSmartList2"><li>In the WAR Display Name field, enter <code class="cCode">books</code>.</li></div><a name="wp117314"> </a><div class="pSmartList2"><li>In the Context Root field, enter <code class="cCode">/books</code>.</li></div><a name="wp117315"> </a><div class="pSmartList2"><li>Click Edit to add the content files. </li></div><a name="wp117316"> </a><div class="pSmartList2"><li>In the Edit Contents dialog, navigate to <code class="cCode">&lt;</code><code class="cVariable">INSTALL</code><code class="cCode">&gt;/j2eetutorial14/examples/web/bookstore5/build</code>/. Select the JSP document <code class="cCode">books.jspx</code> and the <code class="cCode">database</code>, <code class="cCode">listeners</code>, and <code class="cCode">template</code> directories and click Add.</li></div><a name="wp117317"> </a><div class="pSmartList2"><li>Add the shared bookstore library. Navigate to<code class="cCode"> &lt;</code><code class="cVariable">INSTALL</code><code class="cCode">&gt;/j2eetutorial14/examples/build/web/bookstore/dist/</code>. Select <code class="cCode">bookstore.jar</code> and Click Add. Click OK.</li></div><a name="wp117467"> </a><div class="pSmartList2"><li>Click Next.</li></div><a name="wp117473"> </a><div class="pSmartList2"><li>Select the JSP radio button. </li></div><a name="wp117468"> </a><div class="pSmartList2"><li>Click Next.</li></div><a name="wp117469"> </a><div class="pSmartList2"><li>Select /<code class="cCode">books.jspx</code> from the JSP Filename combo box. </li></div><a name="wp117470"> </a><div class="pSmartList2"><li>Click Finish.</li></div></ol></div><a name="wp117342"> </a><div class="pSmartList1"><li>Identify the <code class="cCode">books.jspx</code> as an XML document.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117343"> </a><div class="pSmartList2"><li>Select the JSP Properties tab.</li></div><a name="wp117344"> </a><div class="pSmartList2"><li>Click the Add button next to the Name list.</li></div><a name="wp117345"> </a><div class="pSmartList2"><li>Enter <code class="cCode">books</code>.</li></div><a name="wp117346"> </a><div class="pSmartList2"><li>Click the Add URL button next to the URL Pattern list.</li></div><a name="wp117347"> </a><div class="pSmartList2"><li>Enter <code class="cCode">*.jspx</code>.</li></div><a name="wp117348"> </a><div class="pSmartList2"><li>Select the checkbox labelled &quot;Is XML Document&quot;.</li></div></ol></div><a name="wp121353"> </a><div class="pSmartList1"><li>Add the listener class <code class="cCode">listeners.ContextListener</code> (described in <a  href="Servlets4.html#wp64218">Handling Servlet Life Cycle Events</a>). </li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp121356"> </a><div class="pSmartList2"><li>Select the Event Listeners tab.</li></div><a name="wp121359"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp121348"> </a><div class="pSmartList2"><li>Select the <code class="cCode">listeners.ContextListener</code> class from drop down field in the Event Listener Classes panel.</li></div></ol></div><a name="wp117357"> </a><div class="pSmartList1"><li>Add a resource reference for the database.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117358"> </a><div class="pSmartList2"><li>Select the Resource Refs tab.</li></div><a name="wp117359"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp117360"> </a><div class="pSmartList2"><li>Enter <code class="cCode">jdbc/BookDB</code> in the Coded Name field.</li></div><a name="wp117361"> </a><div class="pSmartList2"><li>Accept the default type <code class="cCode">javax.sql.DataSource</code>.</li></div><a name="wp117362"> </a><div class="pSmartList2"><li>Accept the default authorization <code class="cCode">Container</code>.</li></div><a name="wp117363"> </a><div class="pSmartList2"><li>Accept the default selected <code class="cCode">Shareable</code>.</li></div><a name="wp121489"> </a><div class="pSmartList2"><li>Enter <code class="cCode">jdbc/BookDB</code> in the JNDI name field of the &quot;Sun-specific Settings for jdbc/BookDB&quot; frame.</li></div></ol></div><a name="wp117365"> </a><div class="pSmartList1"><li>Select File<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Save.</li></div><a name="wp117366"> </a><div class="pSmartList1"><li>Deploy the application.</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp117367"> </a><div class="pSmartList2"><li>Select the <code class="cCode">books</code> WAR file from the tree.</li></div><a name="wp117460"> </a><div class="pSmartList2"><li>Select Tools<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Deploy. </li></div><a name="wp117368"> </a><div class="pSmartList2"><li>Click OK.</li></div><a name="wp117305"> </a><div class="pSmartList2"><li>A popup dialog will display the results of the deployment. Click Close.</li></div></ol></div><a name="wp117302"> </a><div class="pSmartList1"><li>Open the bookstore URL <code class="cCode">http://localhost:8080/bookstore5/bookstore</code>.</li></div></ol></div>    </blockquote>   <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider">    <table width="550" summary="layout" id="SummaryNotReq1">      <tr>	<td align="left" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a>	</td>        <td align="center" valign="center"><a accesskey="p" href="JSPX.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="JSPX3.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a>        </td>	<td align="right" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font>	</font>	</td>      </tr>    </table>    <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"><p><font size="-1">All of the material in <em>The J2EE(TM) 1.4 Tutorial</em> is <a href="J2EETutorialFront2.html">copyright</a>-protected and may not be published in other workswithout express written permission from Sun Microsystems.</font>  </body></html>

⌨️ 快捷键说明

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