Class ServletWrapper
java.lang.Object
org.ametys.core.servletwrapper.servlet.ServletWrapper
This class is a generic servlet wrapping an actual
Servlet
.
ServletWrapper
are used to handle servlets from inside the application, instead of inside the servlet engine.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Initialize the servlet in the wrappervoid
service
(Map objectModel, Redirector redirect) Calls service in the servlet, wrapping the request and the responsevoid
service
(HttpServletRequest request, HttpServletResponse response, Map objectModel, Redirector redirect) Calls service in the servlet
-
Constructor Details
-
ServletWrapper
Constructor- Parameters:
servlet
- A servlet to apply
-
-
Method Details
-
init
public void init(String servletName, ServletContext servletContext, Map<String, String> parameters) throws ServletExceptionInitialize the servlet in the wrapper- Parameters:
servletName
- NameservletContext
- Contextparameters
- Parameters- Throws:
ServletException
- Exception if servlet init fails
-
service
Calls service in the servlet, wrapping the request and the response- Parameters:
objectModel
- object modelredirect
- redirector- Throws:
ServletException
- exception thrown by the servletIOException
- exception thrown by the servlet
-
service
public void service(HttpServletRequest request, HttpServletResponse response, Map objectModel, Redirector redirect) throws ServletException, IOException Calls service in the servlet- Parameters:
request
- requestresponse
- responseobjectModel
- object modelredirect
- redirector- Throws:
ServletException
- exception thrown by the servletIOException
- exception thrown by the servlet
-