I like your idea -- using Mav to process the correct html page: query or report. I changed my code to that way and it's much cleaner. Thanks! Dan
At 10:23 PM 2/12/02 -0800, you wrote: > > From: Dan Finkelstein [mailto:[EMAIL PROTECTED]] > > > > Thanks for your approach. I guess there a various ways to structure > > this. I was trying to avoid having two template pages and two >controllers > > for each report. That seemed like too much. Your solution is nice > > because > > you end up with a total of two controllers, and then two template >pages > > for > > each report. > >Yup, lots of ways to skin cats :-) > > > What I ended up doing was putting both the query template page and the > > report template page together in a single template page doing >something > > like this: > > > > <html>.... > > #if ($form) > > html for form goes here > > #else > > html for report goes here > > #end > > ...</html> > > > > And then in the controller is something like this: > > boolean getForm() { return > > getRequest().getMethod().equals("GET"); } > > > > The controller also ends up serving "double-duty", handling the query >and > > the report. I like it because it tends to keep like functionality > > together. > >Just looking at what you have here, why not put the html for the two >separate views in different files and then let the controller choose >between them? The maverick.xml could be something like this: > ><command name="report"> > <controller class="org.foo.Bar"/> > <view name="form" path="form.vm"/> > <view name="report" path="report.vm"/> > <view name="other" ... ></command> > >I tend to shy away from big #if statements in my templates, but of >course everyone is entitled their own aesthetic judgment :-) I also >tend to prefer breaking functionality out into separate classes, sharing >common behavior in a superclass. > > > By the by, I _really_ am enjoying this framework. It truly is > > well-designed and thought through -- it is a pleasure to use. I've >worked > > with and seen many frameworks and this is the first one I've seen that > > really makes sense. (...even without documentation!!!) > >Thanks!!! We love hearing stuff like this :-) > >Jeff Schnitzer >[EMAIL PROTECTED] > >_______________________________________________ >Mav-user mailing list >[EMAIL PROTECTED] >https://lists.sourceforge.net/lists/listinfo/mav-user _______________________________________________ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
