As a proof of concept, I am currently working on converting a small web application of mine to merlin. Since the business logic is completely separated from the presentation layer I thought about transforming said business layer into avalon components to be managed by merlin. The presentation layer uses webwork2 which I find to be a great solution and thus I would be very reluctant to discard it.
I don't really know anything about WebWork, but I think I do have a fairly straight-forward merlin-centric solution for what you are trying to do...
So I am facing some problems:
(1) I have to set up an embedded merlin kernel/container/whatever (well, what exactly do I have to set up?) in a servlet. Is there some canonical way of doing so? Probably not.
(2) I will have to store a reference to this merlin thingy in the JNDI context or servlet context. What exactly would I put there?
(3) User requests are handled in Action classes instantiated and subsequently executed by the webwork servlet. Somehow this classes will have to access i.e. the apps user-manager, a component managed by merlin. How can I manage to do so?
There's another way to look at this. As an alternative to thinking about embedding merlin into your servlet, how about embedding a web server/serlvet container into merlin?
We have a nice thin component that enables merlin to startup an embedded Jetty web server and servlet container. This component currently exposes the Avalon ServiceManager and Logger to any servlet that is deployed in Jetty. Since this component supports WAR deployment in addition to exposing the ServiceManager , you can keep your presentation layer in the web application (servlets, JSP, Struts, Velocity/Turbine, etc.), while deploying your business objects as standard merlin components/blocks.
Your servlet/action classes (deployed as a WAR in the merlin-embedded Jetty) that service your User requests can fetch references to your merlin business layer components via a standard ServiceManager lookup.
I do this sort of thing all the time with some B2B applications that I write for my company. These applications enable trading partners to exchange business documents securely over the internet. I've got a serlvet deployed in the merlin-http component that passes off HTTP POSTs to a handler class (similar to your Action classes I believe) based on some meta data about the POST (like application path, query parameters, etc.) These handlers know how to handle specific types of requests that come from the users. In any case, I think it is good model for allowing you to use merlin to host not only your business layer components, but also host the web server itself that acts as the HTTP gateway for your users.
The merlin-http component is currently available from CVS in the avalon/merlin/web directory. When I come up for air sometime after the first of the year, I'm going to look into making this component a full-fledged merlin kernel extension.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
