org.apache.myfaces.orchestra.urlParamNav
Class UrlParameterViewHandler

java.lang.Object
  extended by ViewHandler
      extended by org.apache.myfaces.orchestra.urlParamNav.UrlParameterViewHandler

public class UrlParameterViewHandler
extends ViewHandler

Allow the to-view-id URL in a faces-config navigation case to include query parameters and EL expressions.

This class plays a few tricks to hide from the real NavigationHandler and ViewHandler classes the fact that a URL contains non-standard data.

This class also plays a few reflection-based tricks so that the code can be compiled against JSF1.1, and work with both JSF1.1 and JSF1.2. The code is a little fragile and will probably need to be updated to work correctly with JSF2.0, but that is the fault of the JSF spec.


Constructor Summary
UrlParameterViewHandler(ViewHandler original)
          Constructor.
 
Method Summary
 java.lang.String calculateCharacterEncoding(FacesContext context)
          Delegate to wrapped instance.
 java.util.Locale calculateLocale(FacesContext context)
           
 java.lang.String calculateRenderKitId(FacesContext context)
           
 UIViewRoot createView(FacesContext context, java.lang.String viewId)
           
 java.lang.String getActionURL(FacesContext context, java.lang.String viewId)
           
 java.lang.String getResourceURL(FacesContext context, java.lang.String path)
           
 void initView(FacesContext context)
          Delegate to wrapped instance.
 void renderView(FacesContext context, UIViewRoot viewToRender)
           
 UIViewRoot restoreView(FacesContext context, java.lang.String viewId)
           
 void writeState(FacesContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlParameterViewHandler

public UrlParameterViewHandler(ViewHandler original)
Constructor.

Method Detail

calculateCharacterEncoding

public java.lang.String calculateCharacterEncoding(FacesContext context)
Delegate to wrapped instance.

This method was added in JSF1.2. We must therefore use reflection to invoke the method on the wrapped instance. Note that this method is never invoked unless this is a JSF1.2 environment.

Since:
1.3

initView

public void initView(FacesContext context)
              throws FacesException
Delegate to wrapped instance.

This method was added in JSF1.2. We must therefore use reflection to invoke the method on the wrapped instance. Note that this method is never invoked unless this is a JSF1.2 environment.

Throws:
FacesException
Since:
1.3

calculateLocale

public java.util.Locale calculateLocale(FacesContext context)

calculateRenderKitId

public java.lang.String calculateRenderKitId(FacesContext context)

createView

public UIViewRoot createView(FacesContext context,
                             java.lang.String viewId)

getActionURL

public java.lang.String getActionURL(FacesContext context,
                                     java.lang.String viewId)

getResourceURL

public java.lang.String getResourceURL(FacesContext context,
                                       java.lang.String path)

renderView

public void renderView(FacesContext context,
                       UIViewRoot viewToRender)
                throws java.io.IOException,
                       FacesException
Throws:
java.io.IOException
FacesException

restoreView

public UIViewRoot restoreView(FacesContext context,
                              java.lang.String viewId)

writeState

public void writeState(FacesContext context)
                throws java.io.IOException
Throws:
java.io.IOException


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