org.apache.myfaces.renderkit.html.util
Class ExtensionsPhaseListener

java.lang.Object
  extended by org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener
All Implemented Interfaces:
Serializable, EventListener, javax.faces.event.PhaseListener

public class ExtensionsPhaseListener
extends Object
implements javax.faces.event.PhaseListener

This phase listener puts in the request the javascript code needed to render the dummyForm and the autoscroll feature. The ExtensionsFilter will put this code before the closing &tt;/body> tag.

Version:
$Revision: 778948 $ $Date: 2009-05-26 20:14:09 -0500 (Tue, 26 May 2009) $
Author:
Bruno Aranda (latest modification by $Author: lu4242 $)
See Also:
Serialized Form

Field Summary
static String LISTENERS_MAP
           
static String ORG_APACHE_MYFACES_MY_FACES_JAVASCRIPT
           
 
Constructor Summary
ExtensionsPhaseListener()
           
 
Method Summary
 void afterPhase(javax.faces.event.PhaseEvent event)
           
 void beforePhase(javax.faces.event.PhaseEvent event)
           
 javax.faces.event.PhaseId getPhaseId()
           
static void writeCodeBeforeBodyEnd(javax.faces.context.FacesContext facesContext)
          In case of StreamingAddResource and a documentBody-Tag, this method will be called with the normal response writer set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORG_APACHE_MYFACES_MY_FACES_JAVASCRIPT

public static final String ORG_APACHE_MYFACES_MY_FACES_JAVASCRIPT
See Also:
Constant Field Values

LISTENERS_MAP

public static final String LISTENERS_MAP
See Also:
Constant Field Values
Constructor Detail

ExtensionsPhaseListener

public ExtensionsPhaseListener()
Method Detail

getPhaseId

public javax.faces.event.PhaseId getPhaseId()
Specified by:
getPhaseId in interface javax.faces.event.PhaseListener

beforePhase

public void beforePhase(javax.faces.event.PhaseEvent event)
Specified by:
beforePhase in interface javax.faces.event.PhaseListener

afterPhase

public void afterPhase(javax.faces.event.PhaseEvent event)
Specified by:
afterPhase in interface javax.faces.event.PhaseListener

writeCodeBeforeBodyEnd

public static void writeCodeBeforeBodyEnd(javax.faces.context.FacesContext facesContext)
                                   throws IOException
In case of StreamingAddResource and a documentBody-Tag, this method will be called with the normal response writer set. It will directly render out the javascript-text at the current position (immediately before body-closing). In the case of DefaultAddResource, this method will be called with a wrapped response writer - and we'll buffer the javascript-text in the request, for the ExtensionFilter to catch and render it.

Parameters:
facesContext - The current faces-context.
Throws:
IOException - Exception if writing to the output-stream fails.


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.