|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.springframework.web.servlet.HttpServletBean
Simple extension of javax.servlet.http.HttpServlet
that treats
its config parameters as bean properties.
A very handy superclass for any type of servlet. Type conversion is automatic. It is also possible for subclasses to specify required properties.
This servlet leaves request handling to subclasses, inheriting the default
behavior of HttpServlet (doGet
, doPost
, etc).
This servlet superclass has no dependency on a Spring application context, in contrast to the FrameworkServlet class which loads its own context.
addRequiredProperty(java.lang.String)
,
initServletBean()
,
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
,
FrameworkServlet
,
Serialized FormField Summary | |
protected Log |
logger
Logger available to subclasses |
Constructor Summary | |
HttpServletBean()
|
Method Summary | |
protected void |
addRequiredProperty(String property)
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. |
void |
init()
Map config parameters onto bean properties of this servlet, and invoke subclass initialization. |
protected void |
initBeanWrapper(BeanWrapper bw)
Initialize the BeanWrapper for this HttpServletBean, possibly with custom editors. |
protected void |
initServletBean()
Subclasses may override this to perform custom initialization. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Log logger
Constructor Detail |
public HttpServletBean()
Method Detail |
protected final void addRequiredProperty(String property)
property
- name of the required propertypublic final void init() throws ServletException
ServletException
- if bean properties are invalid (or required
properties are missing), or if subclass initialization fails.protected void initBeanWrapper(BeanWrapper bw) throws BeansException
bw
- the BeanWrapper to initialize
BeansException
- if thrown by BeanWrapper methodsBeanWrapper.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)
protected void initServletBean() throws ServletException
ServletException
- if subclass initialization fails
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |