Package org.kohsuke.stapler
Class StaticViewFacet
java.lang.Object
org.kohsuke.stapler.Facet
org.kohsuke.stapler.StaticViewFacet
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields inherited from class org.kohsuke.stapler.Facet
ALLOW_VIEW_NAME_PATH_TRAVERSAL, LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionStaticViewFacet(String... allowedExtensions) StaticViewFacet(Collection<String> allowedExtensions) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(String ext) voidbuildIndexDispatchers(MetaClass owner, List<Dispatcher> dispatchers) AddsDispatchers that serves the likes ofindex.EXTThe default implementation invokesFacet.handleIndexRequest(RequestImpl, ResponseImpl, Object, MetaClass)but facet implementations can improve runtime dispatch performance by testing the presence of index view page upfront.voidbuildViewDispatchers(MetaClass owner, List<Dispatcher> dispatchers) AddsDispatchers that look at one token and binds that to the views associated with the 'it' object.jakarta.servlet.RequestDispatchercreateRequestDispatcher(RequestImpl request, Klass<?> type, Object it, String viewName) Creates aRequestDispatcherthat handles the given view, or return null if no such view was found.protected URLfindResource(Klass c, String fileName) Determines if this resource can be servedbooleanhandleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass nodeMetaClass) Attempts to route the HTTP request to the 'index' page of the 'it' object.Methods inherited from class org.kohsuke.stapler.Facet
buildFallbackDispatchers, createRequestDispatcher, createRequestDispatcher, createValidatingDispatcher, discover, discoverExtensions, getExtensionSuffix, getKlass, handleIndexRequest, isBasename
-
Constructor Details
-
StaticViewFacet
-
StaticViewFacet
-
-
Method Details
-
addExtension
-
buildViewDispatchers
Description copied from class:FacetAddsDispatchers that look at one token and binds that to the views associated with the 'it' object.- Specified by:
buildViewDispatchersin classFacet- See Also:
-
findResource
Determines if this resource can be served -
createRequestDispatcher
public jakarta.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request, Klass<?> type, Object it, String viewName) throws IOException Description copied from class:FacetCreates aRequestDispatcherthat handles the given view, or return null if no such view was found.- Overrides:
createRequestDispatcherin classFacettype- If "it" is non-null,it.getClass(). Otherwise the class from which the view is searched.- Throws:
IOException- See Also:
-
buildIndexDispatchers
Description copied from class:FacetAddsDispatchers that serves the likes ofindex.EXTThe default implementation invokesFacet.handleIndexRequest(RequestImpl, ResponseImpl, Object, MetaClass)but facet implementations can improve runtime dispatch performance by testing the presence of index view page upfront.- Overrides:
buildIndexDispatchersin classFacet
-
handleIndexRequest
public boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass nodeMetaClass) throws IOException, jakarta.servlet.ServletException Description copied from class:FacetAttempts to route the HTTP request to the 'index' page of the 'it' object.- Specified by:
handleIndexRequestin classFacet- Returns:
- true if the processing succeeds. Otherwise false.
- Throws:
IOExceptionjakarta.servlet.ServletException- See Also:
-