ch09.html
来自「java2高级编程」· HTML 代码 · 共 985 行 · 第 1/3 页
HTML
985 行
Bidder</EM> enterprise bean. </P><UL><LI CLASS="BL"><A NAME="pgfId-1087498"></A><EM CLASS="CODE">bidder.Bidder.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087499"></A><EM CLASS="CODE">bidder.BidderHome.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087500"></A><EM CLASS="CODE">bidder.BidderBean.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087501"></A><EM CLASS="CODE">bidder.DeploymentDescriptor.txt </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087502"></A><EM CLASS="CODE">BidderBeanEOImpl_ServiceStub.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087503"></A><EM CLASS="CODE">BidderBeanHomeImpl_ServiceStub.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087504"></A><EM CLASS="CODE">WLStub1z35502726376oa1m4m395m4w5j1j5t.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087505"></A><EM CLASS="CODE">WLStub5g4v1dm3m271tr4i5s4b4k6p376d5x.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087506"></A><EM CLASS="CODE">WLSkel1z35502726376oa1m4m395m4w5j1j5t.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087507"></A><EM CLASS="CODE">WLSkel5g4v1dm3m271tr4i5s4b4k6p376d5x.class</EM></LI></UL><P CLASS="Body"><A NAME="pgfId-1087508"></A>Here is how to bundle them. Everything goes on one line, and the command is executed one directory above the place where the class files are located. </P></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087509"></A><EM CLASS="Bold">Unix:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087510"></A>jar cvf bidder.jar bidder/*.class bidder/*.txt</PRE></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087511"></A><EM CLASS="Bold">Win32:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087512"></A>jar cvf bidder.jar bidder\*.class bidder\*.txt</PRE><P CLASS="Body"><A NAME="pgfId-1087513"></A>Once the JAR file is copied to the destination directory for the enterprise beans, unpack it as follows. The extraction creates a <EM CLASS="CODE">bidder</EM> directory with the class files in it. </P><PRE CLASS="CODE"><A NAME="pgfId-1087514"></A>jar xvf bidder.jar</PRE><P CLASS="Body"><A NAME="pgfId-1087515"></A><EM CLASS="C-Code">Seller</EM><EM CLASS="Bold"> Package. </EM>Here are the application files in the seller package that make up the <EM CLASS="CODE">Seller</EM> enterprise bean. </P><UL><LI CLASS="BL"><A NAME="pgfId-1087516"></A><EM CLASS="CODE">seller.Seller.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087517"></A><EM CLASS="CODE">seller.SellerHome.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087518"></A><EM CLASS="CODE">seller.SellerBean.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087519"></A><EM CLASS="CODE">seller.DeploymentDescriptor.txt </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087520"></A><EM CLASS="CODE">SellerBeanEOImpl_ServiceStub.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087521"></A><EM CLASS="CODE">SellerBeanHomeImpl_ServiceStub.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087522"></A><EM CLASS="CODE">WLStub3xr4e731e6d2x3b3w5b693833v304q.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087523"></A><EM CLASS="CODE">WLStub86w3x4p2x6m4b696q4kjp4p4p3b33.class </EM></LI><LI CLASS="BL"><A NAME="pgfId-1087524"></A><EM CLASS="CODE">WLSkel3xr4e731e6d2x3b3w5b693833v304q.class</EM></LI><LI CLASS="BL"><A NAME="pgfId-1087525"></A><EM CLASS="CODE">WLSkel86w3x4p2x6m4b696q4kjp4p4p3b33.class</EM></LI></UL><P CLASS="Body"><A NAME="pgfId-1087526"></A>Here is how to bundle them. Everything goes on one line, and the command is executed one directory above the place where the class files are located. </P></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087527"></A><EM CLASS="Bold">Unix:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087528"></A>jar cvf seller.jar seller/*.class seller/*.txt</PRE></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087529"></A><EM CLASS="Bold">Win32:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087530"></A>jar cvf seller.jar seller\*.class seller\*.txt</PRE><P CLASS="Body"><A NAME="pgfId-1087531"></A>Once the JAR file is copied to the destination directory for the enterprise beans, unpack it as follows. The extraction creates a <EM CLASS="CODE">seller</EM> directory with the class files in it. </P><PRE CLASS="CODE"><A NAME="pgfId-1087532"></A>jar xvf seller.jar</PRE></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087533"></A>Bundle and Deploy the <EM CLASS="B-code">Applet</EM> Program</H5><P CLASS="Body"><A NAME="pgfId-1087536"></A><A NAME="marker-1087534"></A><A NAME="marker-1087535"></A>For this chapter, the <EM CLASS="CODE">Administration</EM> applet family of files consists of two source files: <EM CLASS="CODE">AdminApplet.java</EM> and <EM CLASS="CODE">java.policy</EM>. For reference, Figure 9.1 shows the <EM CLASS="CODE">Admin</EM> applet.</P><DIV><H6 CLASS="FC"><A NAME="pgfId-1087541"></A>Figure 9.1 <EM CLASS="CODE">Administration</EM><A NAME="23417"></A> applet</H6><DIV><IMG SRC="CH09-1.gif"></DIV><PRE CLASS="CODE"><A NAME="pgfId-1087542"></A>grant {</PRE><PRE CLASS="CODE"><A NAME="pgfId-1087543"></A> permission java.lang.RuntimePermission "queuePrintJob";</PRE><PRE CLASS="CODE"><A NAME="pgfId-1087544"></A>};</PRE><P CLASS="Body"><A NAME="pgfId-1087545"></A>Here is the <EM CLASS="CODE">jar</EM> command to bundle them. Everything goes on one line, and the command is executed where the policy file is located, which is one directory above the place where the class files are located. </P></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087546"></A><EM CLASS="Bold">Unix:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087547"></A>jar cvf applet.jar admin/*.class java.policy</PRE></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087548"></A><EM CLASS="Bold">Win32:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087549"></A>jar cvf applet.jar admin\*.class java.policy</PRE><P CLASS="Body"><A NAME="pgfId-1087550"></A>To deploy the applet, copy the <EM CLASS="CODE">applet.jar</EM> file to the destination applet directory and extract it as follows. The extraction creates an <EM CLASS="CODE">admin</EM> directory with the <EM CLASS="CODE">Administration</EM> applet class files in it. </P><PRE CLASS="CODE"><A NAME="pgfId-1087551"></A>jar xvf applet.jar</PRE></DIV></DIV></DIV><DIV><H4 CLASS="A"><A NAME="pgfId-1087553"></A><A NAME="13024"></A>Deploy to Solaris Operating System</H4><P CLASS="Body"><A NAME="pgfId-1087556"></A><A NAME="marker-1087554"></A><A NAME="marker-1087555"></A>Java Plug-in software lets you direct applets or JavaBeans components on intranet Web pages to run using the JRE instead of the Web browser's default virtual machine. The Java Plug-In works with Netscape Communicator and Microsoft Internet Explorer. Free downloads of all the software you need to install and use Java Plug-In are available from the <EM CLASS="A">download</EM> page (<EM CLASS="URL-Footnote">http://java.sun.com/products/plugin/1.2/download/all.html)</EM>. </P><P CLASS="Body"><A NAME="pgfId-1087557"></A>This section explains how to install Java Plug-In with Netscape Communicator on the Solaris operating system.</P><DIV><H5 CLASS="B"><A NAME="pgfId-1087558"></A>Get Downloads</H5><P CLASS="Body"><A NAME="pgfId-1087559"></A>To install and use Java Plug-In on Solaris 2.6 or Solaris 7, you need the following downloads. Put the downloads in a directory anywhere you want. </P><UL><LI CLASS="BL"><A NAME="pgfId-1087560"></A>Java Plug-In for Solaris operating systems. It is available for either Intel or Sparc platforms.</LI><LI CLASS="BL"><A NAME="pgfId-1087561"></A>Java Plug-In patches for either Solaris 2.6 or Solaris 7, depending on which one you have. </LI><LI CLASS="BL"><A NAME="pgfId-1087562"></A>Netscape Communicator 4.5.1 or newer (Webstart version). </LI><LI CLASS="BL"><A NAME="pgfId-1087563"></A>Java Plug-In HTML Converter</LI></UL><P CLASS="Body"><A NAME="pgfId-1087564"></A>These instructions were tested on a Sun Microsystems Ultra 2 running Solaris 2.6 with Netscape Communicator 4.5.1. <EM CLASS="A"></EM><A NAME="extract"></A></P></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087566"></A>Extract Downloaded Files</H5><P CLASS="Body"><A NAME="pgfId-1087567"></A>Go to the directory where you downloaded the files and extract each one. </P><DIV><H6 CLASS="D"><A NAME="pgfId-1087568"></A><EM CLASS="Bold">Extract Java Plug-In files:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087569"></A>zcat plugin-12-webstart-sparc.tar.Z | tar -xf - </PRE></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087570"></A><EM CLASS="Bold">Extract patch files for Solaris 2.6:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087571"></A>zcat JPI1.2-Patches-Solaris2.6-sparc.tar.Z | tar -xf -</PRE></DIV><DIV><H6 CLASS="D"><A NAME="pgfId-1087572"></A><EM CLASS="Bold">Extract Netscape Navigator 4.5.1:</EM></H6><PRE CLASS="CODE"><A NAME="pgfId-1087573"></A>zcat NSCPcom_webstart_sparc.tar.Z | tar -xf -</PRE></DIV></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087574"></A>Install Java Plug-In</H5><P CLASS="Body"><A NAME="pgfId-1087575"></A>The Java Plug-In download includes a user guide that you can view in your browser from the following directory: </P><PRE CLASS="CODE"><A NAME="pgfId-1087576"></A>plugin-12-webstart-sparc/Java_Plug-in_1.2.2/common/Docs/en/Users_Guide_Java_Plug-in.html </PRE><P CLASS="Body"><A NAME="pgfId-1087577"></A>The user guide explains how to install Java Plug-In. There are several easy ways to do it, and the command sequence below is one quick way that installs Java Plug-In in the default <EM CLASS="CODE">/opt/NSCPcom</EM> directory using the <EM CLASS="CODE">pkgadd</EM> command: </P><PRE CLASS="CODE"><A NAME="pgfId-1087578"></A>su<root password>cd ~/plugin-12-webstart-sparcpkgadd -d ./Java_Plug-in_1.2.2/sparc/Product</PRE></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087579"></A>Install Java Plug-In Patches</H5><P CLASS="Body"><A NAME="pgfId-1087580"></A>Before you can run Java Plug-In, you have to install the patches. You install the patches one at a time as root. The following command sequence goes to the patch directory, lists the files, and issues the command to install the first patch: </P><PRE CLASS="CODE"><A NAME="pgfId-1087581"></A>cd ~/JPI1.2-Patches-Solaris2.6-sparCsu<password>kq6py#ls105210-19 105490-07 105568-13kq6py#./105210-19/installpatch 105210-19</PRE><P CLASS="Body"><A NAME="pgfId-1087582"></A>You will see this output when the patch is successfully installed: </P><PRE CLASS="CODE"><A NAME="pgfId-1087583"></A>Patch number 105210-19 has beenZ successfully installed.See /var/sadm/patch/105210-19/log for detailsPatch packages installed: SUNWarc SUNWcsu</PRE><P CLASS="Body"><A NAME="pgfId-1087584"></A>Continue installing the patches one-by-one until all patches have successfully installed. The user's guide provides a list of required and suggested patches and links to where you can download additional suggested patches if you want to install them.</P></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087585"></A>Install Netscape Communicator</H5><P CLASS="Body"><A NAME="pgfId-1087587"></A><A NAME="marker-1087586"></A>The extracted Netscape Communicator 4.5.1 files provide a user's guide in the <EM CLASS="CODE">~/NETSCAPE/Netscape_Communicator_4.51/common/Docs/en</EM> directory that explains the installation. The following command sequence is one easy way to do it with the <EM CLASS="CODE">pkgadd</EM> command. By default, the installation puts Netscape Communicator in the <EM CLASS="CODE">/opt/NSCPcom</EM> directory where your Java Plug-In and patches are also installed. </P><P CLASS="Body"><A NAME="pgfId-1087588"></A>When you extracted the <EM CLASS="CODE">NSCPcom_webstart_sparc.tar.Z</EM> download, it placed the files in a <EM CLASS="CODE">NETSCAPE</EM> directory. From the <EM CLASS="CODE">NETSCAPE</EM> directory, execute the following command sequence: </P><PRE CLASS="CODE"><A NAME="pgfId-1087589"></A>cd ~/NETSCAPE/Netscape_Communicator_4.51/sparc/Productsu<password>pkgadd -d .</PRE></DIV><DIV><H5 CLASS="B"><A NAME="pgfId-1087590"></A>Check the Installation</H5><P CLASS="Body"><A NAME="pgfId-1087591"></A>There are two ways to check your Java Plug-In, patch, and Netscape Communicator installation. </P><OL><LI CLASS="NLS"><A NAME="pgfId-1087592"></A>Open the Netscape <EM CLASS="CODE">Help</EM> menu and select <EM CLASS="CODE">About Plug_Ins</EM>. You will see a list of <EM CLASS="CODE">Mime</EM> types. Check this list against the list presented in the user's guide. If your mime types are correct, the installation is correct and complete.</LI>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?