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 13:50:37 UTC

ajax phase listener

In bpcatalog tutorial there is a special requirement:
putting some xml in faces-config.xml to tell jsf servlet to use a 
special phase listener to manage request.
Why is not this requirement present in myfaces ajax component (for 
example input suggest). How can i easily create an ajax custom component 
using myfaces?

Yours faithfully
John Slave

Re: ajax phase listener

Posted by Dudu <ed...@yahoo.com.br>.
I preffer, use and recommend to use simple servlets to response the request
ajax.
Because PhaseListeners always will be invocated.

On 4/7/06, Werner Punz <we...@gmx.at> wrote:
>
> John Slave schrieb:
> > In bpcatalog tutorial there is a special requirement:
> > putting some xml in faces-config.xml to tell jsf servlet to use a
> > special phase listener to manage request.
> > Why is not this requirement present in myfaces ajax component (for
> > example input suggest).
> Something has to answer on the server if you do ajax, since there are as
> for now no jsf mechanisms, you have to do it either via a jsp, a servlet
> or a phase listener.
> The phase listener approach is the one which is the least intrusive for
> the end user, because it is sort of plug and play.
>
> Sun chose this approach, others choose to use servlets for answering.
>
> >How can i easily create an ajax custom component
> > using myfaces?
> >
> Check out the sources,  I normally do not push people towards the
> sources, but in this case you have to. There are various easy components
> which utilize ajax one way or the other in the sandbox.
> The newer ones use dojo to reduce the amount of code on the javascript
> side.
>
>


--
----------
Dudu
GoogleTalk: eduardopichler[at]gmail[dot]com
skype:eduardopichler

Re: ajax phase listener

Posted by Werner Punz <we...@gmx.at>.
John Slave schrieb:
> In bpcatalog tutorial there is a special requirement:
> putting some xml in faces-config.xml to tell jsf servlet to use a
> special phase listener to manage request.
> Why is not this requirement present in myfaces ajax component (for
> example input suggest). 
Something has to answer on the server if you do ajax, since there are as
for now no jsf mechanisms, you have to do it either via a jsp, a servlet
or a phase listener.
The phase listener approach is the one which is the least intrusive for
the end user, because it is sort of plug and play.

Sun chose this approach, others choose to use servlets for answering.

>How can i easily create an ajax custom component
> using myfaces?
>
Check out the sources,  I normally do not push people towards the
sources, but in this case you have to. There are various easy components
which utilize ajax one way or the other in the sandbox.
The newer ones use dojo to reduce the amount of code on the javascript side.


Re: ajax phase listener

Posted by Craig McClanahan <cr...@apache.org>.
On 4/7/06, John Slave <sl...@libero.it> wrote:
>
> In bpcatalog tutorial there is a special requirement:
> putting some xml in faces-config.xml to tell jsf servlet to use a
> special phase listener to manage request.


You should note that in the more recent versions of these components (and
the way they are packaged with Java Studio Creator) this configuration file
is inside the component jar.  They do use a phase listener, courtesy of
Shale Remoting -- it is shared across all of the components using this
library, versus the early bpcatalog strategy of each component providing
their own listener.

Why is not this requirement present in myfaces ajax component (for
> example input suggest). How can i easily create an ajax custom component
> using myfaces?


Some people prefer to use separate servlets.  But zero configuration
(nothing needs to be added to web.xml) is a pretty nice feature of using a
phase listener.

Yours faithfully
> John Slave
>


Craig