Hi,

this is now working thanks to you all.

Attached is the web.xml. As Rodrigo stated I pruned it down and it turns out that at a 
min I need the 'Servlet Mapped Filter', the invoker mapping.

If anyone can explain the web.xml file in plain lang / what filters do and how to get 
rid of the invoker then please do 


Thomas
 





-----Original Message-----
From: Curley, Thomas 
Sent: 28 November 2002 13:48
To: Tomcat Users List
Subject: RE: How to add a servlet to a new Webapp 


thanks - will try

-----Original Message-----
From: Ruiz [mailto:[EMAIL PROTECTED]]
Sent: 28 November 2002 13:46
To: Tomcat Users List
Subject: Re: How to add a servlet to a new Webapp 


If you copied the examples web.xml, then you must have a lot of references
to servlet classes and filters not present in your new webapp. This can make
the context not to be created, because of exceptions raised during context
initialization. Try to delete all unused entries before starting the server
:-)

Hope it helps

----- Original Message -----
From: "Curley, Thomas" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 28, 2002 2:37 PM
Subject: RE: How to add a servlet to a new Webapp


> Jim - its in both webapps under classes - com.wrox.projsp.ch03.TestServlet
>
> -----Original Message-----
> From: Collins, Jim [mailto:[EMAIL PROTECTED]]
> Sent: 28 November 2002 13:35
> To: 'Tomcat Users List'
> Subject: RE: How to add a servlet to a new Webapp
>
>
> You mention in your first post that the servlet works if you create the
> package structure in WEB-INF/classes. Is the servlet no longer in this
> directory?
>
> > -----Original Message-----
> > From: Curley, Thomas [mailto:[EMAIL PROTECTED]]
> > Sent: 28 November 2002 13:29
> > To: Tomcat Users List
> > Subject: RE: How to add a servlet to a new Webapp
> >
> >
> > Correct ! - I origionally copied the examples web.xml
> >
> > -----Original Message-----
> > From: Collins, Jim [mailto:[EMAIL PROTECTED]]
> > Sent: 28 November 2002 13:28
> > To: 'Tomcat Users List'
> > Subject: RE: How to add a servlet to a new Webapp
> >
> >
> > Thomas has got a mapping to the invoker servlet in the web.xml file he
> > posted so it should not be a problem.
> >
> > > -----Original Message-----
> > > From: mech [mailto:[EMAIL PROTECTED]]
> > > Sent: 28 November 2002 13:25
> > > To: 'Tomcat Users List'
> > > Subject: RE: How to add a servlet to a new Webapp
> > >
> > >
> > > This problem is new with 4.1.12. For security reasons the invoker
> > > servlet had been disabled in the "global" /conf/web.xml file.
> > > This invoker servlet usually loads user servlets that are not mapped
> > > correctly as far as i understand. This is done by using a default
> > > mapping "/servlet/*".
> > > In productive systems this should not be done, instead
> > correct mapping
> > > is required.
> > >
> > > In the /examples webapp the invoker servlet had been enabled
> > > again with
> > > the local web.xml.
> > > That's why it's working in examples and not in study.
> > Because in your
> > > study web.xml you won't have it enabled manually and thus
> > the default
> > > from /conf/web.xml ist used where this feature is disabled.
> > >
> > > Thus the mapping /servlet/... to servlets is just Tomcat
> > specifically
> > > done via the invoker servlet which is now (4.1.12+) disabled
> > > by default.
> > > But actually you should not need /servlet/ at all, if your
> > mapping is
> > > correct.
> > >
> > > Try
> > > http://localhost:8080/study/com.wrox.projsp.ch03.Testservlet or make
> > > a shorter mapping to "/study/Testservlet" in your web.xml
> > >
> > > mech
> > >
> > > > -----Original Message-----
> > > > From: Curley, Thomas [mailto:[EMAIL PROTECTED]]
> > > > Sent: Donnerstag, 28. November 2002 14:06
> > > > To: Tomcat Users List
> > > > Subject: RE: How to add a servlet to a new Webapp
> > > >
> > > >
> > > > Well I also tried
> > > >
> > http://localhost:8080/study/servlet/com.wrox.projsp.ch03.TestServlet
> > > >
> > > > but the same whereas
> > > > http://localhost:8080/examples/servlet/com.wrox.projsp.ch03.Te
> > > > stServlet works
> > > >
> > > >
> > > > ??
> > > >
> > > > Thomas
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Collins, Jim [mailto:[EMAIL PROTECTED]]
> > > > Sent: 28 November 2002 13:04
> > > > To: 'Tomcat Users List'
> > > > Subject: RE: How to add a servlet to a new Webapp
> > > >
> > > >
> > > > I believe that servlet has been disabled by default in 4.1.12
> > > > for security reasons. That is probably why you can't use:
> > > > http://localhost:8080/study/servlet/TestServlet
> > > >
> > > > Jim
> > > >
> > > > > -----Original Message-----
> > > > > From: Curley, Thomas [mailto:[EMAIL PROTECTED]]
> > > > > Sent: 28 November 2002 12:58
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: How to add a servlet to a new Webapp
> > > > >
> > > > >
> > > > > Hi All,
> > > > >
> > > > > Using Tomcat 4.1.12 on Win 2K
> > > > >
> > > > > I am getting a 404 error when I try to create a new webapp
> > > > > and add a very basic servlet.  The servlet works if I create
> > > > > the package structure within the examples WEB-INF/classes.
> > > > > Here are the steps:
> > > > >
> > > > > 1. created webapps/study
> > > > > 2. created
> > > > > .../study/WEB-INF/classes/com/wrox/projsp/ch03/TestServlet.jav
> > > > > a and compiled [ok]
> > > > > 3. added the following line to server.xml after the
> > > > > examples </Context>
> > > > >
> > > > >     <Context path="/study" docBase="study"
> > > > debug="0" >
> > > > >             </Context>
> > > > > 4. just copied the examples web.xml to study/WEB-INF and
> > > > > added the following lines
> > > > >
> > > > >
> > > > >     <servlet>
> > > > >       <servlet-name>
> > > > >           TestServlet
> > > > >       </servlet-name>
> > > > >       <servlet-class>
> > > > >           com.wrox.projsp.ch03.TestServlet
> > > > >       </servlet-class>
> > > > >     </servlet>
> > > > >
> > > > >     <servlet-mapping>
> > > > >         <servlet-name>TestServlet</servlet-name>
> > > > >         <url-pattern>/TestServlet</url-pattern>
> > > > >     </servlet-mapping>
> > > > >
> > > > >
> > > > > 5. restart tomcat
> > > > >
> > > > >
> > > > > RESULT - The requested resource (/study/servlet/TestServlet)
> > > > > is not available.
> > > > >
> > > > >
> > > > > Can anyone see what I am missing ?
> > > > >
> > > > >
> > > > >
> > > > > thanks
> > > > >
> > > > >
> > > > > Thomas
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > > <mailto:[EMAIL PROTECTED]>
> > > > > For additional commands, e-mail:
> > > > > <mailto:[EMAIL PROTECTED]>
> > > > >
> > > >
> > > >
> > > > PLEASE READ: The information contained in this email is
> > confidential
> > > > and intended for the named recipient(s) only. If you are not
> > > > an intended
> > > > recipient of this email you must not copy, distribute or take any
> > > > further action in reliance on it and you should delete it and
> > > > notify the
> > > > sender immediately. Email is not a secure method of
> > > communication and
> > > > Nomura International plc cannot accept responsibility for
> > > the accuracy
> > > > or completeness of this message or any attachment(s). Please
> > > > examine this
> > > > email for virus infection, for which Nomura International
> > > plc accepts
> > > > no responsibility. If verification of this email is sought
> > > then please
> > > > request a hard copy. Unless otherwise stated any views or opinions
> > > > presented are solely those of the author and do not
> > > represent those of
> > > > Nomura International plc. This email is intended for informational
> > > > purposes only and is not a solicitation or offer to buy or sell
> > > > securities or related financial instruments. Nomura
> > > > International plc is
> > > > regulated by the Financial Services Authority and is a
> > member of the
> > > > London Stock Exchange.
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:tomcat-user-> [EMAIL PROTECTED]>
> > > > For
> > > > additional commands,
> > > > e-mail: <mailto:[EMAIL PROTECTED]>
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > > <mailto:tomcat-user-> [EMAIL PROTECTED]>
> > > > For
> > > > additional commands,
> > > > e-mail: <mailto:[EMAIL PROTECTED]>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > PLEASE READ: The information contained in this email is confidential
> > and intended for the named recipient(s) only. If you are not
> > an intended
> > recipient of this email you must not copy, distribute or take any
> > further action in reliance on it and you should delete it and
> > notify the
> > sender immediately. Email is not a secure method of communication and
> > Nomura International plc cannot accept responsibility for the accuracy
> > or completeness of this message or any attachment(s). Please
> > examine this
> > email for virus infection, for which Nomura International plc accepts
> > no responsibility. If verification of this email is sought then please
> > request a hard copy. Unless otherwise stated any views or opinions
> > presented are solely those of the author and do not represent those of
> > Nomura International plc. This email is intended for informational
> > purposes only and is not a solicitation or offer to buy or sell
> > securities or related financial instruments. Nomura
> > International plc is
> > regulated by the Financial Services Authority and is a member of the
> > London Stock Exchange.
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> PLEASE READ: The information contained in this email is confidential
> and intended for the named recipient(s) only. If you are not an intended
> recipient of this email you must not copy, distribute or take any
> further action in reliance on it and you should delete it and notify the
> sender immediately. Email is not a secure method of communication and
> Nomura International plc cannot accept responsibility for the accuracy
> or completeness of this message or any attachment(s). Please examine this
> email for virus infection, for which Nomura International plc accepts
> no responsibility. If verification of this email is sought then please
> request a hard copy. Unless otherwise stated any views or opinions
> presented are solely those of the author and do not represent those of
> Nomura International plc. This email is intended for informational
> purposes only and is not a solicitation or offer to buy or sell
> securities or related financial instruments. Nomura International plc is
> regulated by the Financial Services Authority and is a member of the
> London Stock Exchange.
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd";>

<web-app>
    <display-name>Study</display-name>
    <description>
      Study servlets and JSP pages.
    </description>

    <filter>
        <filter-name>Servlet Mapped Filter</filter-name>
        <filter-class>filters.ExampleFilter</filter-class>
        <init-param>
          <param-name>attribute</param-name>
          <param-value>filters.ExampleFilter.SERVLET_MAPPED</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>Servlet Mapped Filter</filter-name>
        <servlet-name>invoker</servlet-name>
    </filter-mapping>

    <servlet>
      <servlet-name>
          TestServlet
      </servlet-name>
      <servlet-class>
          com.wrox.projsp.ch03.TestServlet
      </servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/TestServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

 </web-app>
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to