tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steven melendez <stevenmelen...@yahoo.com>
Subject RE: new web application - inconsistent resource not found
Date Thu, 16 Jan 2003 23:56:17 GMT
Thank you very much for your suggestions and help.

I created a simple test servlet and added:

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

to the web.xml and was able to call the servlet with
localhost:8080/directoryname/servlet/servletname

I've been following a book which suggesting that I
just add the following to the web.xml for the servlet:
(assume directory structure:
webapps\directoryname\WEB-INF\classes\Something
webapps\directoryname\WEB-INF\web.xml   )

<servlet>
  <servlet-name>Something</servlet-name>
  <servlet-class>Something</servlet-class>
</servlet>

and then suggested that I could access the class
through the following:

http://localhost:8080/directoryname/servlet/Something

but this didn't work for me until I added the servlet
mapping above.  so is the book wrong and I should
always add a mapping or am I missing something else?

thanks again.

--- Wendy Smoak <Wendy.Smoak@asu.edu> wrote:
> Steven wrote:
> > What I have is a couple of jsp files and a couple
> of
> > servlets.  I put them in the examples directory,
> the
> > jsp in the top level, and the servlets in the
> > web-inf/classes directory.  I do not edit the
> web.xml
> > in this directory, and the application works.
> 
> WEB-INF should be capitalized.  Might not matter on
> Windows, though...
> 
> web.xml goes directly in WEB-INF, not in
> WEB-INF/classes.
> 
> What is the URL you are using to access your servlet
> when it works?  When it
> doesn't?  The examples webapp has the invoker
> servlet enabled, so you can
> get to servlets with the
> .../examples/servlet/MyServlet URL without changing
> web.xml.  That may not be true elsewhere.
> 
> > <servlet>
> >    <servlet-name>AddToSC</servlet-name>
> >   
> <servlet-class>cart.AddToSCServlet</servlet-class>
> >  </servlet>
> 
> Is this servlet in the /WEB-INF/classes/cart
> directory, and does it have
>   package cart;
> in the code?  If not, save yourself some future
> trouble and start packaging
> your code now, even if you just dump everything in
> "package mystuff;" for
> now.
> 
> Where's the <servlet-mapping> tag?
> 
> The fact that things do work in examples probably
> means you're just missing
> a few details.  If you're still having trouble, post
> a directory listing of
> what's where, and your web.xml file. 
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources
> Management
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message