开发者

How to configure Jetty programmatically to execute JSP pages?

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?

(Preferable without writing an own servlet for that)

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜