Class WebPBEConfigServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public final class WebPBEConfigServlet
    extends javax.servlet.http.HttpServlet

    Servlet for web PBE config processing.

    This servlet's URL should be called by the webapp administrator at deploy time, for setting the passwords of all the PBE encryptors which have been previously assigned a WebPBEConfig configuration object.

    If web PBE configuration has not been done yet, it will show the user a form containing two inputs for each encryptor: the validation word and the password (retyped).

    • The validation word must be input to the value set on the WebPBEConfig object with its setValidationWord(...) method. This will ensure that only an authorized person will set the encryption passwords.
    • .
    • The password (retyped) must be input to the value which is desired to be the encryption password for each specific encryptor.

    An example web.xml fragment:

      <servlet>
        <servlet-name>webPBEConfigServlet</servlet-name>
        <servlet-class>
          org.jasypt.web.pbeconfig.WebPBEConfigServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
    
      <servlet-mapping>
        <servlet-name>webPBEConfigServlet</servlet-name>
        <url-pattern>/webPBEConfig.do</url-pattern>
      </servlet-mapping>
     

    If this servlet's context is set a logger, it will output messages for both successful and failed attempts to set passwords, including date, time and originating IP address.

    Since:
    1.3
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      protected void doPost​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      private void execute​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)  
      private void writeResponse​(java.lang.String html, javax.servlet.http.HttpServletResponse response)  
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebPBEConfigServlet

        public WebPBEConfigServlet()
    • Method Detail

      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse resp)
                       throws javax.servlet.ServletException,
                              java.io.IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • execute

        private void execute​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • writeResponse

        private void writeResponse​(java.lang.String html,
                                   javax.servlet.http.HttpServletResponse response)
                            throws java.io.IOException
        Throws:
        java.io.IOException