我目前正在与jetty hightide vesion 7一起作为独立服务器。我有一个简单的web项目,其中有一些jsp和后备类,目前我正在将一个未爆炸的战争部署到JETTY_HOME/webapps目录。在码头热部署简单应用
目前,jetty很容易获得任何静态jsp/html更改。如果我理解正确,我可以配置我的应用程序,以便码头在不重新启动服务器的情况下接收任何类更改?目前,我有我的码头-web.xml中:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!--
This is the jetty specific web application configuration file. When
starting a Web Application, the WEB-INF/web-jetty.xml file is looked
for and if found, treated as a
org.eclipse.jetty.server.server.xml.XmlConfiguration file and is
applied to the org.eclipse.jetty.servlet.WebApplicationContext objet
-->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call class="org.eclipse.jetty.util.log.Log" name="debug">
<Arg>executing jetty-web.xml</Arg>
</Call>
<Set name="contextPath">/SimpleDynamicProject</Set>
</Configure>
我还创建了一个SimpleDynamicProject.xml并把它放在JETTY_HOME /上下文。此文件包含:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!--
This is the jetty specific web application configuration file. When
starting a Web Application, the WEB-INF/web-jetty.xml file is looked
for and if found, treated as a
org.eclipse.jetty.server.server.xml.XmlConfiguration file and is
applied to the org.eclipse.jetty.servlet.WebApplicationContext objet
-->
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/SimpleDynamicProject</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/webapps/SimpleDynamicProject</Set>
</Configure>
我也不知道如何正确启动Jetty在我阅读的调试模式也是需要的。我曾尝试与启动服务器:
java -Xdebug -jar start.jar OPTIONS=Server,jsp
和
java -Ddebug -jar start.jar OPTIONS=Server,jsp
这是我第一次使用的码头,但到目前为止,我真的很喜欢它。
感谢您的帮助。
这实际上正是我们现在正在我们的团队中所做的。这几乎是所有需要的配置。另外,我们正在使用tapestry5,这种maven/jetty的组合非常适合。 – Casey 2010-09-07 13:54:33