Sorry to bother again.
Just found out the answer to my own question: I should have used servlet-name ShowMsg 
instead of servlet-class ShowMessage.

>>> William Wu <[EMAIL PROTECTED]> 09/20 9:16 AM >>>
Hello Kevin,

It looks like this:

<?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>
    <servlet>
        <servlet-name>ShowMsg</servlet-name>
        <servlet-class>servlets.ShowMessage</servlet-class>
        <init-param>
            <param-name>message</param-name>
            <param-value>Shibboleth</param-value>
        </init-param>
        <init-param>
            <param-name>repeats</param-name>
            <param-value>5</param-value>
        </init-param>
    </servlet>
</web-app>


>>> Kevin Jones <[EMAIL PROTECTED]> 09/20 3:01 AM >>>
What does your web.xml look like?

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of William Wu
> Sent: 20 September 2000 04:18
> To: [EMAIL PROTECTED]
> Subject: servlet initialization
>
>
> Hello everyone,
>
> I've been learning jsp with Tomcat 3.1 recently, encountered a
> small problem:
> In web.xml I setup initialization parameters to one sevlet, but
> the servlet was not picking them when running, the piece of code
> for initialization is as follows:
>
> private String message;
> private String defaultMessage = "No message.";
> private int repeats = 1;
>
> public void init(ServletConfig config) throws ServletException {
>         super.init(config);
>         message = config.getInitParameter("message");
>         if (message == null) message = defaultMessage;
>         try {
>                 String repeatString = config.getInitParameter("repeats");
>                 repeats = Integer.parseInt(repeatString);
>         } catch (NumberFormatException nfe) {}
> }
>
> Any ideas? BTW, this example is from Chapter 2 of "Core Servlets
> and JavaServer Pages" authored by Marty Hall.
>
> Thanks a lot,
> William
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to