java.lang.Object | |||
↳ | javax.servlet.GenericServlet | ||
↳ | javax.servlet.http.HttpServlet | ||
↳ | org.springframework.web.servlet.HttpServletBean |
Known Direct Subclasses |
Known Indirect Subclasses |
Simple extension of javax.servlet.http.HttpServlet which treats
its config parameters (init-param
entries within the
servlet
tag in web.xml
) as bean properties.
A handy superclass for any type of servlet. Type conversion of config parameters is automatic, with the corresponding setter method getting invoked with the converted value. It is also possible for subclasses to specify required properties. Parameters without matching bean property setter will simply be ignored.
This servlet leaves request handling to subclasses, inheriting the default
behavior of HttpServlet (doGet
, doPost
, etc).
This generic servlet base class has no dependency on the Spring
ApplicationContext
concept. Simple
servlets usually don't load their own context but rather access service
beans from the Spring root application context, accessible via the
filter's ServletContext
(see
WebApplicationContextUtils
).
The FrameworkServlet
class is a more specific servlet base
class which loads its own application context. FrameworkServlet serves
as direct base class of Spring's full-fledged DispatcherServlet
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger | Logger available to subclasses |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overridden method that simply returns
null when no
ServletConfig set yet. | |||||||||||
Overridden method that simply returns
null when no
ServletConfig set yet. | |||||||||||
Map config parameters onto bean properties of this servlet, and
invoke subclass initialization.
| |||||||||||
Set the
Environment that this object runs in.
Any environment set here overrides the |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Subclasses can invoke this method to specify that this property
(which must match a JavaBean property they expose) is mandatory,
and must be supplied as a config parameter.
| |||||||||||
Initialize the BeanWrapper for this HttpServletBean,
possibly with custom editors.
| |||||||||||
Subclasses may override this to perform custom initialization.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
javax.servlet.http.HttpServlet
| |||||||||||
From class
javax.servlet.GenericServlet
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
javax.servlet.Servlet
| |||||||||||
From interface
javax.servlet.ServletConfig
| |||||||||||
From interface
org.springframework.context.EnvironmentAware
|
Logger available to subclasses
Overridden method that simply returns null
when no
ServletConfig set yet.
Overridden method that simply returns null
when no
ServletConfig set yet.
Map config parameters onto bean properties of this servlet, and invoke subclass initialization.
ServletException | if bean properties are invalid (or required properties are missing), or if subclass initialization fails. |
---|
Set the Environment
that this object runs in.
Any environment set here overrides the DefaultWebEnvironment
provided by default.
Subclasses can invoke this method to specify that this property (which must match a JavaBean property they expose) is mandatory, and must be supplied as a config parameter. This should be called from the constructor of a subclass.
This method is only relevant in case of traditional initialization driven by a ServletConfig instance.
property | name of the required property |
---|
Initialize the BeanWrapper for this HttpServletBean, possibly with custom editors.
This default implementation is empty.
bw | the BeanWrapper to initialize |
---|
BeansException | if thrown by BeanWrapper methods |
---|
Subclasses may override this to perform custom initialization. All bean properties of this servlet will have been set before this method is invoked.
This default implementation is empty.
ServletException | if subclass initialization fails |
---|