org.springframework.web.servlet

Class HttpServletBean

    • Field Detail

      • logger

        protected final Log logger
        Logger available to subclasses.
    • Constructor Detail

      • HttpServletBean

        public HttpServletBean()
    • Method Detail

      • addRequiredProperty

        protected final void addRequiredProperty(java.lang.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. 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.

        Parameters:
        property - name of the required property
      • setEnvironment

        public void setEnvironment(Environment environment)
        Set the Environment that this servlet runs in.

        Any environment set here overrides the StandardServletEnvironment provided by default.

        Specified by:
        setEnvironment in interface EnvironmentAware
        Throws:
        java.lang.IllegalArgumentException - if environment is not assignable to ConfigurableEnvironment
      • init

        public final void init()
                        throws ServletException
        Map config parameters onto bean properties of this servlet, and invoke subclass initialization.
        Overrides:
        init in class GenericServlet
        Throws:
        ServletException - if bean properties are invalid (or required properties are missing), or if subclass initialization fails.
      • initServletBean

        protected void initServletBean()
                                throws ServletException
        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.

        Throws:
        ServletException - if subclass initialization fails