Hey Guys,

I dropped both perl and struts mods into sourceforge. Jeff or Scott, you'll
need to create packages in sourceforge for them before I can make releases.
Perl transform is pretty straightforward and stable, so I will release it as
1.0.

The strus wrapper is a whole other beast entirely. I've only tested it on
the example app which it runs perfectly as far as I can tell, but I don't
know how good an indication that is, so I'll probably release it as 0.1.

If anyone has some free time, It'd be cool if they could look at it and make
sure things make sense. I've gone back and forth a couple of times
design-wise on it and it would nice to have some extra eyes on it. The main
problem is that struts is not very modular--their dispatcher (ActionServlet)
does basically all of the request/response routing. I've tried 2 solutions
to wrap Maverick around it. In both cases I've written a controller that
implements ControllerSingleton but extends struts' ActionServlet and
overridden the methods where struts actually writes to the response stream
or redirects the request (processActionForward, processForward,
processInclude, and processValidate), giving this control to maverick. The 2
solutions mainly differ in the way I did the overriding.

ActionServlet basically uses a set of calls to boolean-returning methods to
see if they handled the request, something like

if (processForward(mapping, request, response)
    return;
if (processInclude(mapping, request, response)
    return;
if (processValidate(mapping, form, request, response)
    return;

In the my first version (revision 1.1 in CVS), I relied on passing the super
implementation a FakeHttpServletResponse (which I simply threw away) to find
the result. This is probably more maintainable--if they fix their code, we
don't have change ours, but less efficient--struts will dispatch to jsp's
that will write to a disposable stream, then mav will dispatch to the real
view for processing.

The second version (revision 1.3 in CVS) relies on more logic in the mav
class. For processInclude and processForward it's not such a big deal (those
are pretty simple methods to start with), but processValidate in struts is
not refactored very well, so to seperate out just the view dispatching code
basically meant copying and pasting the first 2/3 of the code, leaving out
the final dispatching bit. This is clearly more efficient (no longer running
unnecessary jsp's), but the copying and pasting code sort of leaves a bad
taste in my mouth.

Additionally, since I am overriding ActionServlet, this won't really work
for struts apps people have written where they are overriding ActionServlet
themselves already. I tried to find a solution where I wasn't overriding
ActionServlet, but there is a lot of important Struts code in there and so
far, this is the best solution I have come up with.

--jim





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user
Archives are available at http://www.mail-archive.com/

Reply via email to