You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Cosma Colanicchia <co...@gmail.com> on 2006/07/03 16:18:00 UTC

Re: Shale and Trinidad

I can see that the shale filtered and viewhandler are triggered.. all
seems configured correctly, but the view controller isn't working.

Can you explain a little how it is supposed to work? Where are the
requests intercepted and those callback methods called? I see those
some code in your PhaseListener that create a ViewControllerCallbacks
instance, but I can't find where its metodhs are invoked. If I knew
it, maybe I could find where the problem is..


Thank you
Cosma


2006/6/22, Cosma Colanicchia <co...@gmail.com>:
> Thank you Craig,
>
> at first I followed the configuration steps listed in the struts-shale
> web site and it didn't work, so I tried to manually configure the
> Shale view handler.
>
> Can you also add Facelets on your playlist? :-)
> I'm using also Facelets, that need its own FaceletViewHandler, but not
> register it in its META-INF/faces-config.xml. I modified a little the
> Facelets jar to make it behave like all the others, registering its
> ViewHandler. This way I can now play with the viewhandlers delegation
> stack changing the jars order in my project. JSF specification doesn't
> mandate any order in loading the META-INF/faces-config, but this seems
> to work at least with OC4J container and I hope that other containers
> will follow the jars order too (probably it's up to MyFaces
> implementation).
>
> Then, I've tried these stacks without success:
>
> (request) -> Trinidad -> Shale -> Facelets (works, but no
> ViewController callbacks)
> (request) -> Shale -> Trinidad -> Facelets (works, but no
> ViewController callbacks)
> (request) -> Trinidad -> Facelets -> Shale (works, but no
> ViewController callbacks)
>
> I've keep out permutations with Facelets wrapping Trinidad, because
> docs explicitly say that it is no good.
>
> My conclusion: the problem isn't related to view hander delegation
> stack. I'll try something else, stay tuned ;-)
>
>
> Cosma
>
>
> 2006/6/21, Craig McClanahan <cr...@apache.org>:
> > On 6/21/06, Cosma Colanicchia <co...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > do you know if Shale can be easily plugged in a MyFaces/Trinidad
> > > project? I'm interested in the ViewController pattern, but I can't
> > > make it work.
> >
> >
> > In principle, this kind of mixing should work, although I haven't tried it
> > myself.
> >
> > > I setup the project as described in the Shale website, and also tried
> > > to manually set ViewViewHandler as the viewhandler in
> > > faces-config.xml.
> >
> >
> > You should not have to do this yourself ... Shale (like Trinidad) includes
> > an embedded faces-config.xml that should register its own facilities.
> >
> > > Stepping through the code I can see that it
> > > correctly find my managed-bean (using the ViewControllerMapper), but
> > > my init method is never called. I don't know which class is supposed
> > > to invoke those callback...
> >
> >
> > How recent is the copy of Shale you are using?  This is important because
> > the mechanism that fires these events was recently (last couple of weeks)
> > updated.
> >
> > > Can this be related to Trinidad? Someone is using these two frameworks
> > along?
> >
> >
> > I will put trying this combination on my list of things to play with.
> >
> > > Thank you
> > > Cosma
> > >
> >
> >
> > Craig
> >
> >
>

Re: Shale and Trinidad

Posted by Cosma Colanicchia <co...@gmail.com>.
I was trying with the init() method but it was never called.. I'm now
trying with prerender() and it works.

Thank you
Cosma


2006/7/3, Craig McClanahan <cr...@apache.org>:
>
>
>
> On 7/3/06, Cosma Colanicchia <co...@gmail.com> wrote:
> > I can see that the shale filtered and viewhandler are triggered.. all
> > seems configured correctly, but the view controller isn't working.
> >
> > Can you explain a little how it is supposed to work? Where are the
> > requests intercepted and those callback methods called? I see those
> > some code in your PhaseListener that create a ViewControllerCallbacks
> > instance, but I can't find where its metodhs are invoked. If I knew
> > it, maybe I could find where the problem is..
>
>
> The actual event calls (via ViewControllerCallbacks) happen in
> ViewPhaseListener .. the call to preprocess is triggered at the end of
> Restore View phase, and the call to prerender is triggered at the beginning
> of of Render Response phase.
>
> Does the managed bean name of your backing bean match the required naming
> pattern to be recognized as a ViewController?  The precise rules are listed
> in the javadocs of
> "org.apache.shale.view.impl.DefaultViewControllerMapper ".
>
> > Thank you
> > Cosma
>
>
> Craig
>
> > 2006/6/22, Cosma Colanicchia <co...@gmail.com>:
> > > Thank you Craig,
> > >
> > > at first I followed the configuration steps listed in the struts-shale
> > > web site and it didn't work, so I tried to manually configure the
> > > Shale view handler.
> > >
> > > Can you also add Facelets on your playlist? :-)
> > > I'm using also Facelets, that need its own FaceletViewHandler, but not
> > > register it in its META-INF/faces-config.xml . I modified a little the
> > > Facelets jar to make it behave like all the others, registering its
> > > ViewHandler. This way I can now play with the viewhandlers delegation
> > > stack changing the jars order in my project. JSF specification doesn't
> > > mandate any order in loading the META-INF/faces-config, but this seems
> > > to work at least with OC4J container and I hope that other containers
> > > will follow the jars order too (probably it's up to MyFaces
> > > implementation).
> > >
> > > Then, I've tried these stacks without success:
> > >
> > > (request) -> Trinidad -> Shale -> Facelets (works, but no
> > > ViewController callbacks)
> > > (request) -> Shale -> Trinidad -> Facelets (works, but no
> > > ViewController callbacks)
> > > (request) -> Trinidad -> Facelets -> Shale (works, but no
> > > ViewController callbacks)
> > >
> > > I've keep out permutations with Facelets wrapping Trinidad, because
> > > docs explicitly say that it is no good.
> > >
> > > My conclusion: the problem isn't related to view hander delegation
> > > stack. I'll try something else, stay tuned ;-)
> > >
> > >
> > > Cosma
> > >
> > >
> > > 2006/6/21, Craig McClanahan <cr...@apache.org>:
> > > > On 6/21/06, Cosma Colanicchia <co...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > do you know if Shale can be easily plugged in a MyFaces/Trinidad
> > > > > project? I'm interested in the ViewController pattern, but I can't
> > > > > make it work.
> > > >
> > > >
> > > > In principle, this kind of mixing should work, although I haven't
> tried it
> > > > myself.
> > > >
> > > > > I setup the project as described in the Shale website, and also
> tried
> > > > > to manually set ViewViewHandler as the viewhandler in
> > > > > faces-config.xml.
> > > >
> > > >
> > > > You should not have to do this yourself ... Shale (like Trinidad)
> includes
> > > > an embedded faces-config.xml that should register its own facilities.
> > > >
> > > > > Stepping through the code I can see that it
> > > > > correctly find my managed-bean (using the ViewControllerMapper), but
> > > > > my init method is never called. I don't know which class is supposed
> > > > > to invoke those callback...
> > > >
> > > >
> > > > How recent is the copy of Shale you are using?  This is important
> because
> > > > the mechanism that fires these events was recently (last couple of
> weeks)
> > > > updated.
> > > >
> > > > > Can this be related to Trinidad? Someone is using these two
> frameworks
> > > > along?
> > > >
> > > >
> > > > I will put trying this combination on my list of things to play with.
> > > >
> > > > > Thank you
> > > > > Cosma
> > > > >
> > > >
> > > >
> > > > Craig
> > > >
> > > >
> > >
> >
>
>

Re: Shale and Trinidad

Posted by Craig McClanahan <cr...@apache.org>.
On 7/3/06, Cosma Colanicchia <co...@gmail.com> wrote:
>
> I can see that the shale filtered and viewhandler are triggered.. all
> seems configured correctly, but the view controller isn't working.
>
> Can you explain a little how it is supposed to work? Where are the
> requests intercepted and those callback methods called? I see those
> some code in your PhaseListener that create a ViewControllerCallbacks
> instance, but I can't find where its metodhs are invoked. If I knew
> it, maybe I could find where the problem is..


The actual event calls (via ViewControllerCallbacks) happen in
ViewPhaseListener .. the call to preprocess is triggered at the end of
Restore View phase, and the call to prerender is triggered at the beginning
of of Render Response phase.

Does the managed bean name of your backing bean match the required naming
pattern to be recognized as a ViewController?  The precise rules are listed
in the javadocs of "org.apache.shale.view.impl.DefaultViewControllerMapper".

Thank you
> Cosma


Craig

2006/6/22, Cosma Colanicchia <co...@gmail.com>:
> > Thank you Craig,
> >
> > at first I followed the configuration steps listed in the struts-shale
> > web site and it didn't work, so I tried to manually configure the
> > Shale view handler.
> >
> > Can you also add Facelets on your playlist? :-)
> > I'm using also Facelets, that need its own FaceletViewHandler, but not
> > register it in its META-INF/faces-config.xml. I modified a little the
> > Facelets jar to make it behave like all the others, registering its
> > ViewHandler. This way I can now play with the viewhandlers delegation
> > stack changing the jars order in my project. JSF specification doesn't
> > mandate any order in loading the META-INF/faces-config, but this seems
> > to work at least with OC4J container and I hope that other containers
> > will follow the jars order too (probably it's up to MyFaces
> > implementation).
> >
> > Then, I've tried these stacks without success:
> >
> > (request) -> Trinidad -> Shale -> Facelets (works, but no
> > ViewController callbacks)
> > (request) -> Shale -> Trinidad -> Facelets (works, but no
> > ViewController callbacks)
> > (request) -> Trinidad -> Facelets -> Shale (works, but no
> > ViewController callbacks)
> >
> > I've keep out permutations with Facelets wrapping Trinidad, because
> > docs explicitly say that it is no good.
> >
> > My conclusion: the problem isn't related to view hander delegation
> > stack. I'll try something else, stay tuned ;-)
> >
> >
> > Cosma
> >
> >
> > 2006/6/21, Craig McClanahan <cr...@apache.org>:
> > > On 6/21/06, Cosma Colanicchia <co...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > do you know if Shale can be easily plugged in a MyFaces/Trinidad
> > > > project? I'm interested in the ViewController pattern, but I can't
> > > > make it work.
> > >
> > >
> > > In principle, this kind of mixing should work, although I haven't
> tried it
> > > myself.
> > >
> > > > I setup the project as described in the Shale website, and also
> tried
> > > > to manually set ViewViewHandler as the viewhandler in
> > > > faces-config.xml.
> > >
> > >
> > > You should not have to do this yourself ... Shale (like Trinidad)
> includes
> > > an embedded faces-config.xml that should register its own facilities.
> > >
> > > > Stepping through the code I can see that it
> > > > correctly find my managed-bean (using the ViewControllerMapper), but
> > > > my init method is never called. I don't know which class is supposed
> > > > to invoke those callback...
> > >
> > >
> > > How recent is the copy of Shale you are using?  This is important
> because
> > > the mechanism that fires these events was recently (last couple of
> weeks)
> > > updated.
> > >
> > > > Can this be related to Trinidad? Someone is using these two
> frameworks
> > > along?
> > >
> > >
> > > I will put trying this combination on my list of things to play with.
> > >
> > > > Thank you
> > > > Cosma
> > > >
> > >
> > >
> > > Craig
> > >
> > >
> >
>