📄 ch13.html
字号:
</p></div></div><div class="section"><a name="howto-jbossjetty-run"></a><div class="titlepage"><div><h3 class="title"><a name="howto-jbossjetty-run"></a>Start the JBoss-Jetty server suite</h3></div></div><p>
Now that you have copied the JBoss-Jetty application files from the JBoss binary distribution archive to the
installation directory, the next step is real easy. Jboss-Jetty is supplied with a command file called
<tt>run.bat jetty</tt> (or <tt>run.sh jetty</tt> on Linux/Unix) that has been
carefully designed to start JBoss-Jetty. So, to start the JBoss-Jetty application server suite, use the
<tt>run jetty</tt> command as shown below:
</p><div class="informaltable" id="d0e9144"><a name="d0e9144"></a><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>Windows 95/98, Windows NT or Windows 2000</td><td>Linux, Solaris and other Unixes</td></tr><tr><td><pre class="programlisting">
chdir C:\JavaApps\jboss-jetty
run jetty
</pre></td><td><pre class="programlisting">
cd /usr/bin/jboss-jetty
./run jetty
</pre></td></tr></tbody></table></div><p>
When JBoss-Jetty is started, it should respond with about three to fours screens of console messages. None of the
messages should be an error message. This is entirely normal. In addition, JBoss-Jetty is preconfigured with an
application that it will automatically deploy when it is started. This is to alert you immediately if, for any
reason, the application fails to deploy properly.
</p><p>
As a quick sanity test to ensure that all is well with your copy of JBoss-Jetty, fire up a copy of your
favourite web browser and open the following URLs with it. If you are reading this document on the same computer
that you have installed JBoss-Jetty, then you may just click the links below (don't forget to use the BACK button
to return here!).
<div class="itemizedlist"><ul><li><p><a name="d0e9164"></a>
<a href="javascript:if(confirm('http://localhost:8080/jboss/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://localhost:8080/jboss/'" tppabs="http://localhost:8080/jboss/" target="_top">http://localhost:8080/jboss/</a> - this should take you to
the sample application that was automatically deployed when JBoss-Jetty was started.
</p></li><li><p><a name="d0e9170"></a>
<a href="javascript:if(confirm('http://localhost:8080/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://localhost:8080/'" tppabs="http://localhost:8080/" target="_top">http://localhost:8080/</a> - this should take you to the HTML
documentation for Jetty.
</p></li><li><p><a name="d0e9176"></a>
<a href="javascript:if(confirm('http://localhost:8080/demo/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://localhost:8080/demo/'" tppabs="http://localhost:8080/demo/" target="_top">http://localhost:8080/demo/</a> - this should take you to
some sample files that are normally supplied with Jetty.
</p></li></ul></div>
</p><p>
Now that you've seen how to start JBoss-Jetty and hopefully verified that all is well, you should also know that
to stop JBoss-Jetty, you need to press the <tt>[CRTL]+[C]</tt> key combination. This would trigger a
controlled shutdown process within JBoss-Jetty.
</p></div><div class="section"><a name="howto-jbossjetty-deploy"></a><div class="titlepage"><div><h3 class="title"><a name="howto-jbossjetty-deploy"></a>Deploy an application with JBoss-Jetty</h3></div></div><p>
[TBD]
</p><p>
The procedure for deploying applications with JBoss-Jetty, the application must be packaged as a JAR, WAR
or EAR file. Examples of what-to-do to deploy Jetty-specific application types with JBoss-Jetty?
</p><div class="section"><a name="d0e9195"></a><div class="titlepage"><div><h4 class="title"><a name="d0e9195"></a>Deploy a JSP-only web app with JBoss-Jetty</h4></div></div><p>
In this section you will learn the basics of deploying an application composed entirely of
<tt>.jsp</tt> files with JBoss-Jetty. You will create and deploy an application named
<tt>hello</tt>. You will also create a <tt>sample.jsp</tt> within
<tt>hello</tt> that will be accessible as <tt>http://localhost/hello/sample.jsp</tt>
on the computer running JBoss-Jetty. For other computers, just replace <tt>localhost</tt> with
the computer's IP name or address.
</p><div class="orderedlist"><ol type="1"><li><p><a name="d0e9219"></a>
Open the file <tt>jetty.xml</tt> in <tt>%JBOSS_HOME%/jBoss-dir/conf/jetty/</tt>
your text editor
</p></li><li><p><a name="d0e9228"></a>
Add the following lines before <tt></configure></tt>. These lines create an
application called hello and configure it's deployment directory to be <tt>helloapp</tt>:
<pre class="programlisting">
<Call name="addWebApplication">
<Arg>/hello/*</Arg>
<Arg><SystemProperty name="jetty.home" default="."/>/webapps/helloapp/</Arg>
<Arg><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml/</Arg>
</Call>
</pre>
</p></li><li><p><a name="d0e9240"></a>
Save the changes to <tt>jetty.xml</tt>
</p></li><li><p><a name="d0e9246"></a>
Create the directory <tt>%JBOSS_HOME%/jetty-dir/webapps/helloapp</tt>
</p></li><li><p><a name="d0e9252"></a>
Create (or copy) a <tt>.jsp</tt> file inside the newly created directory. Call this file
<tt>sample.jsp</tt>.
</p></li><li><p><a name="d0e9261"></a>
Make sure that you have a JDK installed on the server.
</p></li><li><p><a name="d0e9264"></a>
On the JBoss-Jetty computer, start jBoss/Jetty and surf to
<tt>http://localhost/hello/sample.jsp</tt>
</p></li><li><p><a name="d0e9270"></a>
You should find that the <tt>sample.jsp</tt> file is automatically compiled and
it's output is displayed in your browser.
</p></li></ol></div><p>
The <tt>sample.jsp</tt> file was compiled by default because you used
<tt>/etc/webdefault.xml</tt> as the third argument of the <tt>addWebApplication</tt>
call above. Have a look at the contents of the file
<tt>%JBOSS_HOME%/jetty-dir/etc/webdefault.xml</tt> if you want learn more about how to map calls
to a servlet (all .jsp files are processed by a servlet that compiles them first according to webdefault.xml).
</p><p>
If you want to add more jsp-files, just drop them in the <tt>helloapp</tt> directory and do as
you did with <tt>sample.jsp</tt> previously.
</p></div></div><div class="section"><a name="howto-jbossjetty-configure"></a><div class="titlepage"><div><h3 class="title"><a name="howto-jbossjetty-configure"></a>Configure your JBoss-Jetty installation</h3></div></div><p></p></div><div class="section"><a name="howto-jbossjetty-trouble"></a><div class="titlepage"><div><h3 class="title"><a name="howto-jbossjetty-trouble"></a>JBoss-Jetty troubleshooting tips</h3></div></div><p></p></div></div></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch12s72.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch12s72.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch13s16.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13s16.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -