views:

79

answers:

1

I found some hints on Stackoverflow how to enable JSP support in Jetty by editing web.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 beleave that it's so hard for such wide-spread thing as JSP...

A: 

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.

JCD
I was talking about the runtime. The question was about `programmatically` doing something, so I was looking for an API-way to do certain things. Maven and others are build (and other kinds of) environments, but not runtime environments.
java.is.for.desktop