Wicket outside of servlet container

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Wicket outside of servlet container

Timothy Bennett
Now that I've got Wicket apps happily running in a Jetty container
hosted inside an OSGi runtime, I'd like to turn my attention to the next
phase towards a small footprint, highly performant, highly scalable web
application server:

Wicket + MINA + OSGi.

Starting with Wicket v1.1, I understand that Wicket has been decoupled
from it's dependency on a servlet container.  My intention is start an
instance of a MINA-based web server in OSGi, and then implement a MINA
IoHandler to hook in my Wicket-based application.

Does any docs/demos exist (or does anyone have experience) with
executing a Wicket application outside of a servlet container?

For those interested, info on MINA can be found at
http://directory.apache.org/subprojects/network/index.html.

Thanks,
Timothy


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Wicket outside of servlet container

jdonnerstag
Please WicketTester, WicketTestCase and the vaarious Mock* objects.
Many of our core junit tests are based on out-of-container tests.

Juergen

On 1/3/06, Timothy Bennett <[hidden email]> wrote:

> Now that I've got Wicket apps happily running in a Jetty container
> hosted inside an OSGi runtime, I'd like to turn my attention to the next
> phase towards a small footprint, highly performant, highly scalable web
> application server:
>
> Wicket + MINA + OSGi.
>
> Starting with Wicket v1.1, I understand that Wicket has been decoupled
> from it's dependency on a servlet container.  My intention is start an
> instance of a MINA-based web server in OSGi, and then implement a MINA
> IoHandler to hook in my Wicket-based application.
>
> Does any docs/demos exist (or does anyone have experience) with
> executing a Wicket application outside of a servlet container?
>
> For those interested, info on MINA can be found at
> http://directory.apache.org/subprojects/network/index.html.
>
> Thanks,
> Timothy
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Wicket outside of servlet container

Cameron Taggart
In reply to this post by Timothy Bennett
Which version of Jetty are you using?  Are you thinking of replacing
Jetty with MINA?  Why?  I'm very interested in hearing more about your
setup.

Cameron

On 1/2/06, Timothy Bennett <[hidden email]> wrote:

> Now that I've got Wicket apps happily running in a Jetty container
> hosted inside an OSGi runtime, I'd like to turn my attention to the next
> phase towards a small footprint, highly performant, highly scalable web
> application server:
>
> Wicket + MINA + OSGi.
>
> Starting with Wicket v1.1, I understand that Wicket has been decoupled
> from it's dependency on a servlet container.  My intention is start an
> instance of a MINA-based web server in OSGi, and then implement a MINA
> IoHandler to hook in my Wicket-based application.
>
> Does any docs/demos exist (or does anyone have experience) with
> executing a Wicket application outside of a servlet container?
>
> For those interested, info on MINA can be found at
> http://directory.apache.org/subprojects/network/index.html.
>
> Thanks,
> Timothy
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

RE: Wicket outside of servlet container

Bennett, Timothy (JIS - Applications)
In reply to this post by Timothy Bennett
> -----Original Message-----
> From: Juergen Donnerstag [mailto:[hidden email]]
> Sent: Tuesday, January 03, 2006 1:22 AM
> To: [hidden email]
> Subject: Re: [Wicket-user] Wicket outside of servlet container
>
> Please WicketTester, WicketTestCase and the vaarious Mock* objects.
> Many of our core junit tests are based on out-of-container tests.
>

I noticed all these both in the Javadocs and the source tree.
However...

The Mock* stuff all derives from WebApplication, which has dependencies
on the servlet container, namely HttpServletRequest,
HttpServletResponse, and HttpServletContext.  And most of the Mock*
classes are directed at mocking out the servlet dependencies.  That's
still a bit of a problem for me... Which means that even if I use these
mock classes, I still have a runtime dependency on the servlet.jar,
which I'd like to avoid.  I realize it's really just a dependency on a
few interfaces, but I still need the servlet.jar in my classpath.  Would
be nice to avoid this altogether, although I'll probably use the Mock*
stuff as a kickstart...

Peeking around under the covers, it appears that what I really want to
do is extend Application instead of WebApplication, since Application
knows nothing of the servlet container.  However, I suspect there is
some initialization and processing that WebApplication does that I'd
need in my extension of Application that isn't servlet related.

An out-of-container architecture that needs to mock out the servlet
dependencies smells of an opportunity for another level of refactoring.
I'm sure this area is still evolving in Wicket.  I'm thinking something
along the lines of:

***************************************************
* ServletApp * PortletApp * MockApp * MyCustomApp *
***************************************************
*            WebApplication Layer                 *
***************************************************

In my case with MINA, I've simply got a input and output streams of the
HTTP socket.  So MyCustomApp would need to parse the input stream for
headers/params/etc and provide to WebApplication layer to setup Wicket
request/response cycle.  Much like the Mock* stuff appears to do, but
without the express need to introduce the servlet.jar dependency.  This
might even allow you to produce a wicket-core.jar without any external
build/runtime dependencies, and then provide add-on jar artifacts that
add convenience classes for deploying wicket in various environments
(i.e. wicket-servlet.jar, wicket-portlet.jar, wicket-apache.mod, etc)

I don't know... Just thinking outside the J2EE box... And Wicket is the
only web framework that I know that can even come close to doing this...

--timothy


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

RE: Wicket outside of servlet container

Bennett, Timothy (JIS - Applications)
In reply to this post by Timothy Bennett
> -----Original Message-----
> From: Cameron Taggart [mailto:[hidden email]]
> Sent: Tuesday, January 03, 2006 1:49 AM
> To: [hidden email]
> Subject: Re: [Wicket-user] Wicket outside of servlet container
>
> Which version of Jetty are you using?  Are you thinking of
> replacing Jetty with MINA?  Why?  I'm very interested in
> hearing more about your setup.
>

Yup.  I'm trying to get completely away from J2EE.  Jetty's great, don't
get me wrong.  Best servlet container out there in terms of performance,
footprint, embeddability.  I've been a Jetty fan for years.  But... It's
still a servlet container.

One thing that makes Wicket so fresh IMO is the potential it brings to
do web development outside the fat J2EE app server.  Wicket may be the
only thing that can save Java from the coming Ruby on Rails revolution
in the web application space.

And there's still a need for a small footprint, highly performant and
scalable web application solutions for small and embeddable devices.

With Wicket we can say goodbye to JSP forever (thank God!).  It's just
POJO's, and that's a beautiful thing IMO.  Makes it very flexible and
reusable, especially how the Wicket developers have abstracted the
servlet and http protocol away into a nice separation of concerns
architecture.

Now.. MINA is an awesome network protocol development framework.
Extremely performant and very robust.  Handles connection sessions,
provides codec and business logic abstraction, protocol handler plugins,
and filter injections both at the IO and protocol handler layer -- which
gives me the same thing servlet filters gives me.  Anyway, there's work
afoot on a MINA-based webserver that is reported to significantly
outperform Apache2 with massive simultaneously connections.  It'll be a
cinch to drop this web server in an OSGi runtime along with my Wicket
application, and I'm good to go both on a big server box or on a small
device like a router or a media device box.  And if I'm building servers
(like an Identity Management/AuthZ/AuthN server like Safehaus, or an
LDAP server, or whatever) why should I have to embed a frickin' servlet
container just to host an remote server admin web application?

With Wicket, I can easily package by web application to deploy as a WAR
in a traditional servlet container, or package an OSGi bundle for
embedded deployment in a non-J2EE runtime.  I'm already doing this.
It's a simple Maven2 build switch.  That's a powerful option I have with
Wicket.  Now with the OSGi architecture, and it's hot-swappable
plugin/bundle capabilities, and the component nature of the Wicket POJO
architecture together, I *could* deploy my Wicket based application as a
series of decoupled bundles or plugins.  Reusability and de-coupleness
at the compile time is a great thing, but reusability and de-coupleness
at runtime is a really beautiful thing.  Imagine adding new pages to my
web application, by simply pushing down an new bundle to my OSGi
runtime?  Think something like what Eclipse has done to the desktop IDE
for web application.  Plugin functionality for the web application.
J2EE and servlet container was not architected for this kind of
robustness -- OSGi completely is -- which is why Eclipse settled on OSGi
as a runtime platform.  With Wicket as the web app framework, I just
need a HTTP protocol pipe input/output stream and some session
management, and throw it over to a handler to let Wicket process the
request and generate the HTML response.  MINA is perfect for this.

I'm going to be embarking on a proof-of-principal.  Safehaus will mostly
like host the project, and I'll try to use my blog as sort of an
electronic developer notebook...

-- timothy


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: Wicket outside of servlet container

Igor Vaynberg-2
In reply to this post by Bennett, Timothy (JIS - Applications)
we already have the abstraction outside of the mock objects. i think juergen meant for you to look at those to get the idea of how things work, but not to reuse them directly.

we have Application, Session, Request, Response

all these have the WebXXX subclasses which provide http servlet specific func. you should be able to replace the WebXXX hierarchy with your specific implementations.

on one of my projects im using osgi/jetty/wicket and it works great. but if there is indeed a more light weight alternative i would be all for it.

where is your blog, i would like to follow along with you. i wish i had some time to contribute, but i am already stetched past my means.

-Igor


On 1/3/06, Bennett, Timothy (JIS - Applications) <[hidden email]> wrote:
> -----Original Message-----
> From: Juergen Donnerstag [mailto:[hidden email]]
> Sent: Tuesday, January 03, 2006 1:22 AM
> To: [hidden email]
> Subject: Re: [Wicket-user] Wicket outside of servlet container
>
> Please WicketTester, WicketTestCase and the vaarious Mock* objects.
> Many of our core junit tests are based on out-of-container tests.
>

I noticed all these both in the Javadocs and the source tree.
However...

The Mock* stuff all derives from WebApplication, which has dependencies
on the servlet container, namely HttpServletRequest,
HttpServletResponse, and HttpServletContext.  And most of the Mock*
classes are directed at mocking out the servlet dependencies.  That's
still a bit of a problem for me... Which means that even if I use these
mock classes, I still have a runtime dependency on the servlet.jar,
which I'd like to avoid.  I realize it's really just a dependency on a
few interfaces, but I still need the servlet.jar in my classpath.  Would
be nice to avoid this altogether, although I'll probably use the Mock*
stuff as a kickstart...

Peeking around under the covers, it appears that what I really want to
do is extend Application instead of WebApplication, since Application
knows nothing of the servlet container.  However, I suspect there is
some initialization and processing that WebApplication does that I'd
need in my extension of Application that isn't servlet related.

An out-of-container architecture that needs to mock out the servlet
dependencies smells of an opportunity for another level of refactoring.
I'm sure this area is still evolving in Wicket.  I'm thinking something
along the lines of:

***************************************************
* ServletApp * PortletApp * MockApp * MyCustomApp *
***************************************************
*            WebApplication Layer                 *
***************************************************

In my case with MINA, I've simply got a input and output streams of the
HTTP socket.  So MyCustomApp would need to parse the input stream for
headers/params/etc and provide to WebApplication layer to setup Wicket
request/response cycle.  Much like the Mock* stuff appears to do, but
without the express need to introduce the servlet.jar dependency.  This
might even allow you to produce a wicket-core.jar without any external
build/runtime dependencies, and then provide add-on jar artifacts that
add convenience classes for deploying wicket in various environments
(i.e. wicket-servlet.jar, wicket-portlet.jar, wicket-apache.mod, etc)

I don't know... Just thinking outside the J2EE box... And Wicket is the
only web framework that I know that can even come close to doing this...

--timothy


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&amp;alloc_id865&amp;opclick">http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user