【发布时间】:2010-03-04 02:59:23
【问题描述】:
我目前正在使用 jetty hightide vesion 7 作为独立服务器。我有一个简单的 web 项目,其中包含几个 jsp 和支持类,我目前正在将它们部署到 JETTY_HOME/webapps 目录的未爆炸战争中。
目前,jetty 可以轻松获取任何静态 jsp/html 更改。如果我理解正确,我可以配置我的应用程序,以便码头将在不重新启动服务器的情况下获取任何类更改?我目前在我的 jetty-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/contexts 中。该文件包含:
<?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
这是我第一次使用jetty,但到目前为止我真的很喜欢它。
感谢您的帮助。
【问题讨论】:
标签: java jakarta-ee jetty