I'm trying to follow a tutorial on Tapestry. (http://tapestry.apache.org/tapestry5.1/tutorial1/env.html) The tutorial recommends Jetty 5.1 so I can use a plugin called JettyLauncher to run Jetty applications from inside Eclipse. Right now though, Jetty is at version 7 I believe. I don't want to start with an out of date web server. Does Jetty 7 have any eclipse plugins similar to what I imagine Jetty 5.1 + Jetty Launcher is supposed to do?
Thanks
EDIT: I'm trying Run Jetty Run and m2eclipse. We'll see how this works
you can go to window -> preferences -> server -> runtime environments and choose to add a new server environment. in th efollowing dialog you can download the "additional server adapters". ther you can chose the Jetti adapter. This way you can configure and use jetty as stated in the WTP documentation (i.e you can configure a new jetty instance in the server view and start stop synch it from there).
Running Jetty through the m2eclipse (jetty:run) works very well. On the other hand, my preferred way of using Jetty is starting in embedded mode (i.e. launching it programatically). This snippet works for Jetty 6, including debugging. I haven't tested it in Jetty 7, but I guess it can be easily adapted for 7:
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext();
webapp.setParentLoaderPriority(true);
webapp.setContextPath("/");
webapp.setWar("src/main/webapp");
server.setHandler(webapp);
try {
server.start();
server.join();
}
catch (Exception e) {
e.printStackTrace();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With