Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by BenGidley: http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA ------------------------------------------------------------------------------ [http://www.jetbrains.com/idea/index.html Intellij IDEA 7.0.3][[BR]] [http://mortbay.org/jetty-6/ Jetty 6] - Note: [http://tapestry.apache.org/tapestry5/tapestry-test/ Tapestry-test] users need to use Jetty 5. + Note: [http://tapestry.apache.org/tapestry5/tapestry-test/ Tapestry-test] users need to use Jetty 5. For an alternative option see Tapestry5RunViaMain == Option 1: Building/launching via Maven == @@ -84, +84 @@ Now you can run your app normally. When you need to fix a bug, just switch to IDEA and fix it; when you switch back to your browser, IDEA will make and deploy the change for you (and Tapestry 5 will pick it up!) - == Option 3 - Create a Jetty Run Main Class == - - This option lets you create a class in your project that runs your application. This has a number of benefits - * Runs directly from compile output directory - so no waiting for copying files - * Works in all IDE's exactly the same - * Debugging/Profiling/Running work perfectly - - This assumes you are running with Maven. - - To make this work - - 1. Add a dependency on Jetty to your POM at provided scope. Use the jetty-server-dependencies and jetty-provided-apis artifacts - 1. Turn off J2EE deployment in module properties - 1. Add a class like the following to your src/test/resources - {{{ - public class RunTapestryApp { - - public static void main(String[] args) throws Exception { - Server server = new Server(); - - Connector connector = new SelectChannelConnector(); - connector.setPort(Integer.getInteger("jetty.port", 8080)); - server.setConnectors(new Connector[]{connector}); - - String jetty_home = System.getProperty("jetty.home", "./"); - - WebAppContext webapp = new WebAppContext(); - webapp.setContextPath("/"); - webapp.setWar(jetty_home + "src/main/webapp"); - webapp.setDefaultsDescriptor(jetty_home + "src/test/resources/webdefault.xml"); - - // Remove slf4j from list of classes not exposed to webapp - webapp.setServerClasses(new String[] {"-org.mortbay.jetty.plus.jaas.", "org.mortbay.jetty."}); - - server.setHandler(webapp); - - server.start(); - server.join(); - } - } - }}} - - This might be a bad idea if you want to use Tapestry-test since it depends on Jetty 5 at present. - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
