org.apache.myfaces.webapp.filter
Class TomahawkFacesContextWrapper

java.lang.Object
  extended by javax.faces.context.FacesContext
      extended by org.apache.myfaces.webapp.filter.TomahawkFacesContextWrapper

public class TomahawkFacesContextWrapper
extends javax.faces.context.FacesContext

This class acts as an alternative to ExtensionsFilter feature.

It wraps the FacesContext using TomahawkFacesContextFactory. See this class for parameters and additional information

If ExtensionsFilter is used on servlet environment, this wrapper is not used. You can set this wrapper using the following configuration: org.apache.myfaces.CHECK_EXTENSIONS_FILTER false org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER false

Remember map the FacesServet to the org.apache.myfaces.RESOURCE_VIRTUAL_PATH value (default /faces/myFacesExtensionResource, so map FacesServlet to /faces/* could be used or better /faces/myFacesExtensionResource/*) so the ServeResourcePhaseListener can serve resources.

One use that has this wrapper is in portlets (there is no PortletFilter on portlet api 1.0, so to take all tomahawk advantages (components that uses some javascript handled by AddResource api and fileupload support) users must configure this alternative.

When it is used this alternative, the params used to configure MultipartRequestWrapper (file upload support) are set using this web.xml config params:

Since:
1.1.7
Author:
Martin Marinschek

Constructor Summary
TomahawkFacesContextWrapper(javax.faces.context.FacesContext delegate)
           
TomahawkFacesContextWrapper(javax.faces.context.FacesContext delegate, ExtensionsResponseWrapper extensionsResponseWrapper)
           
 
Method Summary
 void addMessage(String clientId, javax.faces.application.FacesMessage message)
           
 javax.faces.application.Application getApplication()
           
 Iterator getClientIdsWithMessages()
           
 javax.el.ELContext getELContext()
          This method uses reflection to call the method of the delegated FacesContext getELContext, present on 1.2.
 javax.faces.context.ExternalContext getExternalContext()
           
 javax.faces.application.FacesMessage.Severity getMaximumSeverity()
           
 Iterator getMessages()
           
 Iterator getMessages(String clientId)
           
 javax.faces.render.RenderKit getRenderKit()
           
 boolean getRenderResponse()
           
 boolean getResponseComplete()
           
 javax.faces.context.ResponseStream getResponseStream()
           
 javax.faces.context.ResponseWriter getResponseWriter()
           
 javax.faces.component.UIViewRoot getViewRoot()
           
 boolean isValidContentType(String contentType)
           
 void release()
           
 void renderResponse()
           
 void responseComplete()
           
 void setExternalContext(javax.faces.context.ExternalContext extContext)
           
 void setResponseStream(javax.faces.context.ResponseStream responseStream)
           
 void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
           
 void setViewRoot(javax.faces.component.UIViewRoot root)
           
 
Methods inherited from class javax.faces.context.FacesContext
getCurrentInstance, setCurrentInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TomahawkFacesContextWrapper

public TomahawkFacesContextWrapper(javax.faces.context.FacesContext delegate)

TomahawkFacesContextWrapper

public TomahawkFacesContextWrapper(javax.faces.context.FacesContext delegate,
                                   ExtensionsResponseWrapper extensionsResponseWrapper)
Method Detail

getELContext

public javax.el.ELContext getELContext()
This method uses reflection to call the method of the delegated FacesContext getELContext, present on 1.2. This should be done since we need compatibility between 1.1 and 1.2 for tomahawk

Returns:

getApplication

public javax.faces.application.Application getApplication()
Specified by:
getApplication in class javax.faces.context.FacesContext

getClientIdsWithMessages

public Iterator getClientIdsWithMessages()
Specified by:
getClientIdsWithMessages in class javax.faces.context.FacesContext

getExternalContext

public javax.faces.context.ExternalContext getExternalContext()
Specified by:
getExternalContext in class javax.faces.context.FacesContext

getMaximumSeverity

public javax.faces.application.FacesMessage.Severity getMaximumSeverity()
Specified by:
getMaximumSeverity in class javax.faces.context.FacesContext

getMessages

public Iterator getMessages()
Specified by:
getMessages in class javax.faces.context.FacesContext

getMessages

public Iterator getMessages(String clientId)
Specified by:
getMessages in class javax.faces.context.FacesContext

getRenderKit

public javax.faces.render.RenderKit getRenderKit()
Specified by:
getRenderKit in class javax.faces.context.FacesContext

getRenderResponse

public boolean getRenderResponse()
Specified by:
getRenderResponse in class javax.faces.context.FacesContext

getResponseComplete

public boolean getResponseComplete()
Specified by:
getResponseComplete in class javax.faces.context.FacesContext

getResponseStream

public javax.faces.context.ResponseStream getResponseStream()
Specified by:
getResponseStream in class javax.faces.context.FacesContext

setResponseStream

public void setResponseStream(javax.faces.context.ResponseStream responseStream)
Specified by:
setResponseStream in class javax.faces.context.FacesContext

getResponseWriter

public javax.faces.context.ResponseWriter getResponseWriter()
Specified by:
getResponseWriter in class javax.faces.context.FacesContext

setResponseWriter

public void setResponseWriter(javax.faces.context.ResponseWriter responseWriter)
Specified by:
setResponseWriter in class javax.faces.context.FacesContext

getViewRoot

public javax.faces.component.UIViewRoot getViewRoot()
Specified by:
getViewRoot in class javax.faces.context.FacesContext

setViewRoot

public void setViewRoot(javax.faces.component.UIViewRoot root)
Specified by:
setViewRoot in class javax.faces.context.FacesContext

addMessage

public void addMessage(String clientId,
                       javax.faces.application.FacesMessage message)
Specified by:
addMessage in class javax.faces.context.FacesContext

release

public void release()
Specified by:
release in class javax.faces.context.FacesContext

isValidContentType

public boolean isValidContentType(String contentType)

renderResponse

public void renderResponse()
Specified by:
renderResponse in class javax.faces.context.FacesContext

responseComplete

public void responseComplete()
Specified by:
responseComplete in class javax.faces.context.FacesContext

setExternalContext

public void setExternalContext(javax.faces.context.ExternalContext extContext)


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