org.omnifaces.facesviews
Enum FacesServletDispatchMethod

java.lang.Object
  extended by java.lang.Enum<FacesServletDispatchMethod>
      extended by org.omnifaces.facesviews.FacesServletDispatchMethod
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FacesServletDispatchMethod>

public enum FacesServletDispatchMethod
extends java.lang.Enum<FacesServletDispatchMethod>

The method used by FacesViews to invoke the FacesServlet.

Since:
1.4
Author:
Arjan Tijms

Enum Constant Summary
DO_FILTER
          With this method the FacesViewsForwardingFilter will use a plain FilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) to invoke the FacesServlet.
FORWARD
          With this method the FacesViewsForwardingFilter will use a forward to invoke the FacesServlet.
 
Method Summary
static FacesServletDispatchMethod valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FacesServletDispatchMethod[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FORWARD

public static final FacesServletDispatchMethod FORWARD
With this method the FacesViewsForwardingFilter will use a forward to invoke the FacesServlet. Using this method the FacesServlet does not have to be mapped to the (extensionless) requested resource or to everything (/*).

When forwarding any filters being used by the application do have to be taken into account. Filters defined to be run AFTER the FacesViewsForwardingFilter will NOT RUN when they are not (also) set to dispatch on FORWARD. Filters defined to be run BEFORE the FacesViewsForwardingFilter have to be careful in what they do; forwarding is defined to clear the existing response buffer.


DO_FILTER

public static final FacesServletDispatchMethod DO_FILTER
With this method the FacesViewsForwardingFilter will use a plain FilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) to invoke the FacesServlet. Using this method necessitates the FacesServlet to be mapped to the (extensionless) requested resource or to everything (/*).

The first method is relatively easy using the Servlet 3.0 programmatic registration, but may be troublesome for Servlet 2.5 or manual (declarative) registrations. Mapping the FacesServlet to everything (/*) is not recommenced, and mapping it to a path (/somepath/*) with only Facelets views in it pretty much ruins the entire effect of using FacesViews in the first place.

Method Detail

values

public static FacesServletDispatchMethod[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FacesServletDispatchMethod c : FacesServletDispatchMethod.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FacesServletDispatchMethod valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null