I'm running Tomcat 406 on Redhat9
I have a working Struts app
I've added a second servlet to web.xml, specifying load-on-startup 2
(where 1 is Action servlet
The second servlet is ignored (or at least it doesn't produce anything
in the logs) - the log shows the parsing of the web.xml going normally
(no errors).
Can anyone tell me what I didn't do / did wrong?
Les
+ web.xml +++
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;
web-app
!-- Standard Action Servlet Configuration (with debugging) --
servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
param-namedebug/param-name
param-value3/param-value
/init-param
init-param
param-namedetail/param-name
param-value2/param-value
/init-param
load-on-startup1/load-on-startup
/servlet
!-- Initialization servlet --
servlet
servlet-nameglsi-init/servlet-name
servlet-classcom.glsi.share.ApplicationInitialze/servlet-class
init-param
param-nameglsi-config/param-name
param-value/WEB-INF/classes/glsi-config.properties/param-value
/init-param
load-on-startup2/load-on-startup
/servlet
!-- Standard Action Servlet Mapping --
servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
/servlet-mapping
!-- The Usual Welcome File List --
welcome-file-list
welcome-fileindex.jsp/welcome-file
/welcome-file-list
!-- Struts Tag Library Descriptors --
taglib
taglib-uri/tags/struts-bean/taglib-uri
taglib-location/WEB-INF/struts-bean.tld/taglib-location
/taglib
taglib
taglib-uri/tags/struts-html/taglib-uri
taglib-location/WEB-INF/struts-html.tld/taglib-location
/taglib
taglib
taglib-uri/tags/struts-logic/taglib-uri
taglib-location/WEB-INF/struts-logic.tld/taglib-location
/taglib
taglib
taglib-uri/tags/struts-nested/taglib-uri
taglib-location/WEB-INF/struts-nested.tld/taglib-location
/taglib
taglib
taglib-uri/tags/struts-tiles/taglib-uri
taglib-location/WEB-INF/struts-tiles.tld/taglib-location
/taglib
/web-app
+ The servlet
/*
* ApplicationInitialize.java
*
* Created on December 15, 2003, 12:36 PM
*/
package com.glsi.share;
import java.io.*;
import java.net.*;
import java.util.Properties;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Performs initialization for glsi class-libraries-based applications
* @author Les
* @version
*/
public class ApplicationInitialize extends HttpServlet {
/**
* The codeLog/code instance for this application.
*/
private Log log =
LogFactory.getLog(com.glsi.share.ApplicationInitialize);
/** Initializes the servlet.
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
System.out.println(Hi there, I'm the
initializer);
String cfgPathName = config.getInitParameter(config);
Properties cfgProps = new Properties();
try{
cfgProps.load(new FileInputStream(cfgPathName));
} catch (Exception ie) {
log.info(Error loading glsi-config.properties +
ie.getMessage());
}
log.info(glsi-config.properties loaded);
}
/** Destroys the servlet.
*/
public void destroy() {
}
/** Processes requests for both HTTP codeGET/code and
codePOST/code methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType(text/html);
PrintWriter out = response.getWriter();
/* output your page here
out.println(html);
out.println(head);
out.println(titleServlet/title);
out.println(/head);
out.println(body);
out.println(/body);
out.println(/html);
*/
out.close();
}
/** Handles the HTTP codeGET/code method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}
/** Handles the HTTP codePOST/code method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}
/** Returns a short description of the