tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: The requested resource (/BookSource/DispatchServlet) is not a vailable.
Date Fri, 01 Nov 2002 14:00:59 GMT
you need a <servlet-mapping>(after <servlet>) in your web.xml. Your class is
in the correct place.try
<servlet-mapping>
	<servlet-name>DispatchServlet</servlet-name>
	<url-pattern>/BookStore/DispatchServlet</url-pattern>
</servlet-mapping>

this may just be your email, but 'web-inf' should be 'WEB-INF'

you cannot access servlets in this way. therefore change:
>    <jsp:forward
> page="web-inf/classes/BookStore/DispatchServlet"/>

to:
<jsp:forward page="/BookStore/DispatchServlet"/>

Charlie

> -----Original Message-----
> From: Nalini [mailto:nalinisp@yahoo.com]
> Sent: Friday, November 01, 2002 7:48 AM
> To: Alfonso Martinez; Tomcat Users List
> Subject: Re: The requested resource 
> (/BookSource/DispatchServlet) is not
> available.
> 
> 
> Hi, 
> I tried with the syntax you gave and also with the
> syntax below. It gives the same error. Where should I
> put my servlet class files. I have copied them under
> the directory
> BookSource\web-inf\classes\BookStore\DispatchServlet.class.
> Is this right? 
> 
> <% if(request.getMethod().equals("POST")) %>
>    <jsp:forward
> page="web-inf/classes/BookStore/DispatchServlet"/>
> 
> Thanks in advance.
> Nalini
> 
> 
> --- Alfonso Martinez <trilock@linuxcenter.com.mx>
> wrote:
> > I am not really sure about your form sintax:
> > 
> > <FORM method='POST' onsubmit=<jsp:forward
> > page='DispatchServlet'/> >
> > ...
> > 
> > try 
> > 
> > <FORM method='POST' action="/DispatchServlet">
> > ...
> > 
> > I hope this helps.
> > 
> > 
> > Jose Alfonso
> > 
> > 
> > On Thu, Oct 31, 2002 at 09:16:19AM -0800, Nalini
> > wrote:
> > > Hi,
> > > 
> > > I am writing my first JSP, servlets application
> > using
> > > Tomcat 4.1 server. I have a Win 98 machine.
> > > I created a directory called "BookSource" under
> > ROOT
> > > under webapps.
> > > This is my directory structure.
> > > C:\jakarta-tomcat\webapps\ROOT\BookSource
> > > 
> > > I have web-inf and login.jsp under this directory.
> > > Under web-inf I have classes sub-directory and
> > > web.xml.
> > > I have DispatchServlet.class(under
> > package/directory
> > > BookStore) under the classes sub-directory.
> > > 
> > > My web.xml is 
> > > 
> > > 
> > > <?xml version="1.0" encoding="ISO-8859-1" ?> 
> > > <!DOCTYPE web-app (View Source for full
> > doctype...)> 
> > > <web-app> 
> > > <servlet> 
> > > <servlet-name>DispatchServlet</servlet-name> 
> > > <description>This servlet plays the "controller"
> > role
> > > in the MVC architecture used in this application.
> > It
> > > is generally mapped to the ".do" filename
> > extension
> > > with a servlet-mapping element, and all form
> > submits
> > > in the app will be submitted to a request URI like
> > > "saveCustomer.do", which will therefore be mapped
> > to
> > > this servlet. The initialization parameter namess
> > for
> > > this servlet are the "servlet path" that will be
> > > received by this servlet (after the filename
> > extension
> > > is removed). The corresponding value is the name
> > of
> > > the action class that will be used to process this
> > > request.</description> 
> > >
> >
> <servlet-class>BookStore.DispatchServlet</servlet-class>
> > > 
> > >  <!-- 
> > >  Load this servlet at server startup time 
> > > --> 
> > > <load-on-startup>5</load-on-startup> 
> > > </servlet> 
> > > <session-config> 
> > > <session-timeout>30</session-timeout> 
> > > <!-- 
> > >  30 minutes 
> > > --> 
> > > </session-config> 
> > > </web-app>
> > > 
> > > 
> > > and my login.jsp is 
> > > 
> > > 
> > > <HTML>
> > > <HEAD>
> > > <TITLE>Book Store Login Page</TITLE>
> > > </HEAD>
> > > <BODY>
> > > <FORM method='POST' onsubmit=<jsp:forward
> > > page='DispatchServlet'/> >
> > > <INPUT TYPE="submit" VALUE="Login">
> > > </FORM>
> > > </BODY>
> > > </HTML>
> > > 
> > > I am getting the error when I try to load the page
> > 
> > > http://localhost:8080/BookSource/login.jsp
> > > 
> > > HTTP Status 404 - /BookSource/DispatchServlet
> > > 
> > >
> >
> --------------------------------------------------------------
> ------------------
> > > 
> > > type Status report
> > > 
> > > message /BookSource/DispatchServlet
> > > 
> > > description The requested resource
> > > (/BookSource/DispatchServlet) is not available.
> > > 
> > > 
> > >
> >
> --------------------------------------------------------------
> ------------------
> > > 
> > > Apache Tomcat/4.1.12-LE-jdk14
> > > 
> > > 
> > > Could someone help me fix this problem. thanks in
> > > advance.
> > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do you Yahoo!?
> > > HotJobs - Search new jobs daily now
> > > http://hotjobs.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>
> > > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.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>

--
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