Package org.springframework.mock.web
Class MockServletConfig
java.lang.Object
org.springframework.mock.web.MockServletConfig
- All Implemented Interfaces:
ServletConfig
Mock implementation of the
ServletConfig
interface.- Since:
- 1.0.2
- Author:
- Rod Johnson, Juergen Hoeller
-
Constructor Summary
ConstructorDescriptionCreate a new MockServletConfig with a defaultMockServletContext
.MockServletConfig
(@Nullable ServletContext servletContext) Create a new MockServletConfig.MockServletConfig
(@Nullable ServletContext servletContext, String servletName) Create a new MockServletConfig.MockServletConfig
(String servletName) Create a new MockServletConfig with a defaultMockServletContext
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addInitParameter
(String name, String value) getInitParameter
(String name)
-
Constructor Details
-
MockServletConfig
public MockServletConfig()Create a new MockServletConfig with a defaultMockServletContext
. -
MockServletConfig
Create a new MockServletConfig with a defaultMockServletContext
.- Parameters:
servletName
- the name of the servlet
-
MockServletConfig
Create a new MockServletConfig.- Parameters:
servletContext
- the ServletContext that the servlet runs in
-
MockServletConfig
Create a new MockServletConfig.- Parameters:
servletContext
- the ServletContext that the servlet runs inservletName
- the name of the servlet
-
-
Method Details
-
getServletName
- Specified by:
getServletName
in interfaceServletConfig
-
getServletContext
- Specified by:
getServletContext
in interfaceServletConfig
-
addInitParameter
-
getInitParameter
- Specified by:
getInitParameter
in interfaceServletConfig
-
getInitParameterNames
- Specified by:
getInitParameterNames
in interfaceServletConfig
-