Class BasicSpringRestServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.servlet.RestServlet
org.apache.juneau.rest.springboot.SpringRestServlet
org.apache.juneau.rest.springboot.BasicSpringRestServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
,BasicUniversalConfig
,DefaultConfig
,DefaultHtmlConfig
,BasicRestOperations
- Direct Known Subclasses:
BasicSpringRestServletGroup
public abstract class BasicSpringRestServlet
extends SpringRestServlet
implements BasicRestOperations, BasicUniversalConfig
Subclass of
SpringRestServlet
with default settings and standard methods defined.
Meant as base class for top-level REST resources in Spring Boot environments.
Provides support for JSON, XML, HTML, URL-Encoding, UON, XML, OpenAPI, and MessagePack. See BasicUniversalConfig
for details.
Implements the basic REST endpoints defined in BasicRestOperations
.
See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
error()
[* /error] - Error occurred.[GET favicon.ico] - Retrieve favorites icon image.[GET /htdocs/*] - Retrieve static file.getStats
(RestRequest req) [GET /stats] - Timing statistics.getSwagger
(RestRequest req) [GET /api] - Show resource options.Methods inherited from class org.apache.juneau.rest.springboot.SpringRestServlet
createBeanStore
Methods inherited from class org.apache.juneau.rest.servlet.RestServlet
destroy, doLog, getContext, getPath, getRequest, getResponse, init, log, log, service, setContext
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
BasicSpringRestServlet
public BasicSpringRestServlet()
-
-
Method Details
-
getSwagger
Description copied from interface:BasicRestOperations
[GET /api] - Show resource options.- Specified by:
getSwagger
in interfaceBasicRestOperations
- Parameters:
req
- The HTTP request.- Returns:
- A bean containing the contents for the OPTIONS page.
-
getHtdoc
Description copied from interface:BasicRestOperations
[GET /htdocs/*] - Retrieve static file.- Specified by:
getHtdoc
in interfaceBasicRestOperations
- Parameters:
path
- The path to retrieve.locale
- The locale of the HTTP request.- Returns:
- An HTTP resource representing the static file.
- Throws:
NotFound
-
getFavIcon
Description copied from interface:BasicRestOperations
[GET favicon.ico] - Retrieve favorites icon image.- Specified by:
getFavIcon
in interfaceBasicRestOperations
- Returns:
- A bean containing the contents for the OPTIONS page.
-
error
Description copied from interface:BasicRestOperations
[* /error] - Error occurred.- Specified by:
error
in interfaceBasicRestOperations
-
getStats
Description copied from interface:BasicRestOperations
[GET /stats] - Timing statistics.Timing statistics for method invocations on this resource.
- Specified by:
getStats
in interfaceBasicRestOperations
- Parameters:
req
- The HTTP request.- Returns:
- A collection of timing statistics for each annotated method on this resource.
-