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 TypeMethodDescriptionvoid
addExtension
(String ext) void
buildIndexDispatchers
(MetaClass owner, List<Dispatcher> dispatchers) AddsDispatcher
s that serves the likes ofindex.EXT
The 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.void
buildViewDispatchers
(MetaClass owner, List<Dispatcher> dispatchers) AddsDispatcher
s that look at one token and binds that to the views associated with the 'it' object.jakarta.servlet.RequestDispatcher
createRequestDispatcher
(RequestImpl request, Klass<?> type, Object it, String viewName) Creates aRequestDispatcher
that handles the given view, or return null if no such view was found.protected URL
findResource
(Klass c, String fileName) Determines if this resource can be servedboolean
handleIndexRequest
(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:Facet
AddsDispatcher
s that look at one token and binds that to the views associated with the 'it' object.- Specified by:
buildViewDispatchers
in 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:Facet
Creates aRequestDispatcher
that handles the given view, or return null if no such view was found.- Overrides:
createRequestDispatcher
in classFacet
type
- 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:Facet
AddsDispatcher
s that serves the likes ofindex.EXT
The 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:
buildIndexDispatchers
in classFacet
-
handleIndexRequest
public boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass nodeMetaClass) throws IOException, jakarta.servlet.ServletException Description copied from class:Facet
Attempts to route the HTTP request to the 'index' page of the 'it' object.- Specified by:
handleIndexRequest
in classFacet
- Returns:
- true if the processing succeeds. Otherwise false.
- Throws:
IOException
jakarta.servlet.ServletException
- See Also:
-