The reason the original "global view" concept was dropped was a
complaint on this list that it's easy to make mistakes. I ended up
doing this myself accidentally a few times:
<command name="simpleProtected">
<controller class="org.blah.SomethingProtected"/>
<view path="simple.jsp"/>
</command>
It only has one view, so why bother naming it, right? It all works
great until the rare circumstance that somebody tries to access the page
without being logged in, in which case they get an exception instead of
the usual "You must log in first" page.
It's a terrible kind of error because it can go undiscovered for a
looong time. If you have to explicitly specify each possible view, this
problem won't come up.
However, it sounds like there is a lot of desire to revisit the issue
despite the risk.
Maybe something like this?
<maverick>
<commands>
<global-views>
<view name="loginRequired" path="blah.html"/>
<view name="loginFailed" path="blah2.html"/>
</global-views>
<command name="protected">
<controller class="org.foo.Bar"/>
<view name="success" path="foo.jsp"/>
</command>
</commands>
</maverick>
Another thing to consider is a suggestion that Chris Sturm made to allow
an XSL transform of the maverick.xml before it is processed. With a
transformation, it would be easy to create a config file like this:
<maverick>
<commands>
<command name="bar" protected="true">
<controller class="org.foo.Bar"/>
<view name="success" path="foo.jsp"/>
</command>
</commands>
</maverick>
The XSL could add the two extra views (loginRequired and loginFailed) to
any views with the protected attribute.
Jeff Schnitzer
[EMAIL PROTECTED]
> -----Original Message-----
> From: Gerald de Jong [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Mav-user] global views
>
> when i first understood the "global view" concept (no name for it at
the
> time) i assumed it was a hierarchical thing. i figured you could
corral a
> bunch of commands together and give them a few views to fall back on.
> turns
> out they were truly global. i was thinking "cascade".
>
> what say we talk about groups of commands with groups of default
views?
> make
> just one of these groups and you've got the elegance of 1.0. make a
whole
> bunch of them and you can get granularity as high as you please.
>
> you end up with a "command-set" rather than a single "command" being
> self-contained.
>
> isn't this a good way to scope views?
>
> On Thursday 14 February 2002 20:34, Scott Hernandez wrote:
> > Before I go into a discussion of the why... Let me ask this:
> >
> > Should there be an option to have global views work they used to? (I
was
> > thinking along the lines of a param for the config file to switch
modes)
> >
> >
> > -----------------
> > Jeff and I spent a good amount of time discussing this since the 1.0
> > release. What we wanted to provide was a way to define global views,
> > like we already had, but not always to copy them into each command.
We
> > basically wanted to be able to guarantee that a command could be
> > self-contained. If you looked at the command def, you would see all
view
> > paths out. This led us down the road of global views with local
command
> > refs.
>
> --
> Beautiful Code BV
> Rotterdam, The Netherlands
> http://www.beautifulcode.nl
>
> _______________________________________________
> 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