I found some hints on Stackoverflow how to enable JSP support in Jetty by editing we开发者_如何转开发b.xml
.
But can this be done programmatically, without any web.xml
?
Even REST services support with Jersey can be enabled programmatically in Jetty. I can't believe that it's so hard for such wide-spread thing as JSP...
Programmatically, I'm not sure...but if you're looking for simplicity, check out Maven. You can easily include the Jetty plugin in your pom.xml:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
Then compile your code and start up the Jetty server with the command:
mvn clean compile jetty:run
Doesn't get much more simple than that. As long as you have your file structure adhere to Maven's standards, it'll take care of the rest.
精彩评论