Class ResourceInclude

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener

public class ResourceInclude extends OutputFamily

The <o:resourceInclude> component can be used to catch the output from a JSP or Servlet resource and render it as output to the Faces writer. In effect, this allows you to include both Servlets and JSP pages in e.g. Facelets.

Note that this isn't recommended as a lasting solution, but it might ease a migration from legacy JSP with smelly scriptlets and all on them to a more sane and modern Facelets application.

Author:
Arjan Tijms, Bauke Scholtz
See Also:
  • Field Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE
      The component type, which is "org.omnifaces.component.output.ResourceInclude".
      See Also:
  • Constructor Details

    • ResourceInclude

      public ResourceInclude()
  • Method Details

    • encodeBegin

      public void encodeBegin(FacesContext context) throws IOException
      Create a dispatcher for the resource given by the component's path attribute, catch its output and write it to the Faces response writer.
      Overrides:
      encodeBegin in class UIComponentBase
      Throws:
      IOException
    • getPath

      public String getPath()
      Returns the pathname to the resource. The pathname must begin with a "/" and is interpreted as relative to the current context root.
      Returns:
      The pathname to the resource.
    • setPath

      public void setPath(String path)
      Sets the pathname to the resource. The pathname must begin with a "/" and is interpreted as relative to the current context root.
      Parameters:
      path - The pathname to the resource.