Success Story

<[email protected]> Tue, 8 Feb 2005 10:50:59 +0100
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
Hi All,

Just thought I'd take the opportunity to thank everyone contributing to =
this most
excellent framework. We are basing all our web work on Maverick now and =
have set
up a collection of components that work very well together that possibly =
others
could benefit from using. If anyone is interested, please let us know =
and well
post the code somewhere. Here's what we're using;

In the middle we have a PicoContainer in which we register both servlets =
and
controllers that make up our web application. We have patched the Jetty =
webserver
slightly so that it collects servlets from the container rather than =
instantiating them
directly. Although this is not in accordance with the Servlet spec, it =
allows our servlets
to have dependencies towards other components in the container that will =
be
injected automatically.

Then we made a simple ControllerFactory that also collects controllers =
from
the PicoContainer so that our controllers also may have dependecies =
towards
various other components in the application, that will be injected =
automatically.
The recent addition of the ControllerFactory helped very much here. It =
is very nice
to be able to just specify any dependencies on other components in the =
controller
constructor and have them injected automatically.

Finally, we made a generic ScriptedController that accepts a <script> =
element
in the maverick.xml configuration. The scripted controller reads the =
script pointed
out by the <script> element and compiles it to bytecode using the Pnuts =
library.
(actually ScriptedController has a dependency towards a ScriptEngine =
which is
satisfied by the PicoContainer, although the implementation we have =
currently uses
Pnuts). This allows us to have scripted controllers that are dynamically =
recompiled
when the script file on disk is modified. In addition, HTTP parameters =
are made
instantly available to the script as local variables, together with =
session and
application context variables. The scripted controllers are extremely =
compact
compared to their Java counterparts (on the expense of lack of IDE =
support)
and they're jst as fast (well pretty much anyway).

This small collection of components work extremely well for us, together =
with
Velocity. It is quite rewarding to sit down with our customers and just =
open
Notepad and modify a controller or a view and then refresh the web page =
to see
the changes immediately, in run-time without restarting anything. We may =
combine
regular Java controllers with scripted controllers if we like.

So, if anyone is interested let us know. Perhaps a toolbox project for =
Maverick
should be created somewhere where helper components may be posted?

Thanks again,
Greger Ohlson.




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
[INVALID FOOTER]