Hello,

I'm a beginer with the servlets, and I'm learning with a tutorial that you
can find in www.coreserlets.com .
My server is the Tomcat V3.1, and the problem I encountered is as follow:
I want to send 1 parameter (with a "name" and a "value") from the web.xml
file to my servlet, so I
changed (many times) the configuration of the web.xml file (see the bold
part of the file extract below).
But it seems that the method I use in the "init" part of my java project:

private String message;
...
message = config.getInitParameter("message");

doesn't work properly. And I have the same problem with the value :

private int repeats = 1;
...
repeats = Integer.parseInt(repeatString);

When I display the page with the browser, it never takes in account the name
of the parameter nor its value.
I suppose that the problem comes from the xml file...
Thanks in advance for your help.

Philip.



WEB.XML  FILE



<?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>coreservlets.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>
                        <taglib>
                        <taglib-uri>/tags</taglib-uri>
                        
<taglib-location>/WEB-INF/tags/HelloTagLib.tld</taglib-location>
                        </taglib>

    <servlet>
        <servlet-name>
            servlet1
        </servlet-name>
        <servlet-class>
            requestMap.Servlet1
        </servlet-class>
    </servlet>
    <servlet>
        <servlet-name>
            servlet2.....
        .......

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to