You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by John Slave <sl...@libero.it> on 2006/04/07 18:23:00 UTC

Myfaces inputajax suggest and ajaxPhaseListener

Does myfaces require to put ajaxPhaseListener registration in 
faces-config.xml or does it work even without it? And if the second 
question is true how can do that?

Thank you
John Slave

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by Matthias Wessendorf <mw...@gmail.com>.
> Yeah i know. But how can do it? I want to replicate the behaviour with
> my custom components...how can it automatically register phase listener?

I guess I don't get you

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by John Slave <sl...@libero.it>.
Craig McClanahan ha scritto:
> On 4/7/06, *John Slave* <slaves@libero.it <ma...@libero.it>> 
> wrote:
>
>     Yeah i know. But how can do it? I want to replicate the behaviour with
>     my custom components...how can it automatically register phase
>     listener?
>
>
> If you place a faces-config.xml file in the "META-INF" directory of a 
> jar file that contains your custom components, it will be 
> automatically processed as the application starts up.  You can 
> register your own phase listener there (as well as your components and 
> renderers) -- or anything else that can be configured in such a file.
>
> Registering a phase listener would mean putting something like this in 
> META-INF/faces-config.xml:
>
>     <lifecycle>
>         
> <phase-listener>com.mycompany.mypacakge.MyPhaseListener</phase-listener>
>     </lifecycle>
>
>     Thank you
>     John Slave
>
>
>
> Craig
>
Really thank you
John Slave

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by Werner Punz <we...@gmx.at>.
Matthias Wessendorf schrieb:
>> ... automatically processed as the application starts up...
> 
> ah, I guess thought it was clear. or I wasn't clear enough :-)
> 
> the automatically processing is indeed a very nice feature, like it!
> 
Yes it indeed is, but there are several weaknesses.
First it is that there is no gurantee about the calling order
secondly, at every request, the entire registered phase listener cascade
is processed. Which means add a lot of phase listeners
some doing more complicated stuff and even if they are not needed, but 
badly written in the worst case they can drag down the performance 
without you even noticing that they are doing it.

Dont get me wrong I like pase listeners, but I also get some kind of
second thought before having to apply that pattern to a component 
implementation.


Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by Matthias Wessendorf <mw...@gmail.com>.
> ... automatically processed as the application starts up...

ah, I guess thought it was clear. or I wasn't clear enough :-)

the automatically processing is indeed a very nice feature, like it!

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by Craig McClanahan <cr...@apache.org>.
On 4/7/06, John Slave <sl...@libero.it> wrote:
>
> Yeah i know. But how can do it? I want to replicate the behaviour with
> my custom components...how can it automatically register phase listener?


If you place a faces-config.xml file in the "META-INF" directory of a jar
file that contains your custom components, it will be automatically
processed as the application starts up.  You can register your own phase
listener there (as well as your components and renderers) -- or anything
else that can be configured in such a file.

Registering a phase listener would mean putting something like this in
META-INF/faces-config.xml:

    <lifecycle>
        <phase-listener>com.mycompany.mypacakge.MyPhaseListener
</phase-listener>
    </lifecycle>

Thank you
> John Slave
>


Craig

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by John Slave <sl...@libero.it>.
Matthias Wessendorf ha scritto:
> John,
>
> MyFaces doesn't require you to manually add a PhaseListener for
> runnin' that AJAX stuff. It's done by sandbox.jar itself
>
> http://svn.apache.org/viewcvs.cgi/*checkout*/myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml?rev=392232
>
> Make it *easier* to use sandbox, because you don't have to touch yet
> another xml config
>
> HTH,
> Matthias
>
> On 4/7/06, John Slave <sl...@libero.it> wrote:
>   
>> Does myfaces require to put ajaxPhaseListener registration in
>> faces-config.xml or does it work even without it? And if the second
>> question is true how can do that?
>>
>> Thank you
>> John Slave
>>
>>     
>
>
> --
> Matthias Wessendorf
> Zülpicher Wall 12, 239
> 50674 Köln
> http://www.wessendorf.net
> mwessendorf-at-gmail-dot-com
>
>   
Yeah i know. But how can do it? I want to replicate the behaviour with 
my custom components...how can it automatically register phase listener?

Thank you
John Slave

Re: Myfaces inputajax suggest and ajaxPhaseListener

Posted by Matthias Wessendorf <mw...@gmail.com>.
John,

MyFaces doesn't require you to manually add a PhaseListener for
runnin' that AJAX stuff. It's done by sandbox.jar itself

http://svn.apache.org/viewcvs.cgi/*checkout*/myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml?rev=392232

Make it *easier* to use sandbox, because you don't have to touch yet
another xml config

HTH,
Matthias

On 4/7/06, John Slave <sl...@libero.it> wrote:
> Does myfaces require to put ajaxPhaseListener registration in
> faces-config.xml or does it work even without it? And if the second
> question is true how can do that?
>
> Thank you
> John Slave
>


--
Matthias Wessendorf
Zülpicher Wall 12, 239
50674 Köln
http://www.wessendorf.net
mwessendorf-at-gmail-dot-com