I have an old application written using Struts 1.1 that has a subclass of 
ActionServlet which overrides the init() method to load data from some XML 
files.  It works fine w/ Struts 1.1.  I haven't touched it for years but now 
need to do some work on it.  My current Netbeans environment has Struts 1.2.9 
and I figured I would just update it to the newer version but for the life of 
me I can't get the system to call the init() method.  I have the subclass 
listed as the action servlet in web.xml (snippet below) and I can break in the 
doGet and doPost methods so the servlet is definitely being used as the 
ActionServlet in the application.  Why isn't it calling the init() and/or 
init(ServletConfig config) methods?  

    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>TimeClockServlet2.TimeClockActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>debug</param-name>
            <param-value>2</param-value>
        </init-param>
        <init-param>
            <param-name>detail</param-name>
            <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

Warm Regards,
Dave

Reply via email to