Thanks. Mind if I (or you) put it on the Wiki?

Eelco

Stefan Arentz wrote:

This might be useful for other people too. I'm playing with Wicket, mostly making little applications to figure out how it all works. Like a little blog app, etc.

Personally I find it a pain to create a standard web app for each of these experiments, so I'm using the embedded Jetty server.

The Wicket Kickstart project also does this, but I'm taking an even more simple approach: instead of having an actual document root and web.xml, I simply create the whole server from my main():

(Warning, quick hack code :-)

   HttpServer server = new HttpServer();
   server.addListener(":8080");
   HttpContext context = server.getContext("/");
   ServletHandler handler = new ServletHandler();
ServletHolder servletHolder = handler.addServlet("Wicket","/*", "wicket.protocol.http.WicketServlet"); servletHolder.setInitParameter("applicationClassName", "helloworld.HelloWorldApplication");
   context.addHandler(handler);
   server.start();

This is enough to bootstrap Wicket. No standard web app structure required.

In my IDE (IDEA) I simply have defined two 'Global Libraries'. One for Wicket and one for Jetty 4.2. So the only thing actually in my projects is the above main(), Wicket Page and Application subclasses and static content. The latter in the classpath instead of the document root.

Works great.

I'm also trying to find out how I can let dynamically reloading code work better. It would be awesome to start Wicket like this and then be able to just change code and introduce new pages (and other code) without having to restart the servlet engine ever again.

 S.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to