Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Serving JSP with Jetty

Hi,

I am trying to figure out how to serve JSP with Jetty 7, similar to
the way its done with PHP (ie, I dont want to have to create a WAR
file, I just want to serve the JSP files). I am configuring Jetty
programatically since its running embedded in a Java application.

I tried to serve them using a ResourceHandler:

ResourceHandler rh = new ResourceHandler();
rh.setResourceBase("www");
rh.setWelcomeFiles(new String[] { "index.jsp" });
server.setHandler(rh);

But Jetty just outputs the plain text contents of the file, which is
strange since I have the jsp engine jarfiles in my classpath.

So my question is, how can I get Jetty to serve .jsp files from a directory?

Thanks,
Erin


Back to the top