This is very cool. I wonder if Tomcat can do this too.
Is Jetty really easier to use than Tomcat? If so, maybe I'll switch.
>>> [EMAIL PROTECTED] 2005-07-17 5:31:20 AM >>>
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
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
______________________________________________________________________
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
Katun Corporation -- www.katun.com
_____________________________________________________________________
-------------------------------------------------------
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