Class ServletWrapper
- java.lang.Object
-
- org.ametys.core.servletwrapper.servlet.ServletWrapper
-
public class ServletWrapper extends Object
This class is a generic servlet wrapping an actualServlet
.ServletWrapper
are used to handle servlets from inside the application, instead of inside the servlet engine.
-
-
Constructor Summary
Constructors Constructor Description ServletWrapper(Servlet servlet)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
init(String servletName, ServletContext servletContext, Map<String,String> parameters)
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 Detail
-
ServletWrapper
public ServletWrapper(Servlet servlet)
Constructor- Parameters:
servlet
- A servlet to apply
-
-
Method Detail
-
init
public void init(String servletName, ServletContext servletContext, Map<String,String> parameters) throws ServletException
Initialize the servlet in the wrapper- Parameters:
servletName
- NameservletContext
- Contextparameters
- Parameters- Throws:
ServletException
- Exception if servlet init fails
-
service
public void service(Map objectModel, Redirector redirect) throws ServletException, IOException
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
-
-