SOLVED.

Thanks a lot.

To sum it all up :-

1. Have a JSP say index.jsp
2. Compile a decent servlet ,say Router.
3. The form tag shuld have
        <form method="post" name=indexForm action="Router" >
4. The servlet will be found by server.xml and web.xml

server.xml entry is :-
  <Context path="/osp" docBase="osp" debug="0" reloadable="true" />

web.xml entry is :-

<servlet>
  <servlet-name>Router</servlet-name>
  <servlet-class>osp.servlet.Router</servlet-class>
   <load-on-startup>1</load-on-startup>
</servlet>

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

5. The way it works is bottom up -- From the URL pattern to name to class
file.

Thats should be sufficient for jsp pages to talk  to the Servlet. In my case
this is a Router servlet which will simply be a router in a MVC kind of
Appln. I am using the
  RequestDispatcher dispatcher =     context.getRequestDispatcher("<jsp name
here");

To go fwd after the processing by business objects.
In Coding Phase thanks to you all,

Tript Singh



----- Original Message -----
From: "Ben Ricker" <[EMAIL PROTECTED]>
To: "Triptpal Singh Lamba" <[EMAIL PROTECTED]>
Sent: Thursday, November 21, 2002 3:18 PM
Subject: Re: urgent - servlet not found.


> On Thu, 2002-11-21 at 14:15, Triptpal Singh Lamba wrote:
> >
> > ----- Original Message -----
> > From: "Ben Ricker" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <[EMAIL PROTECTED]>
> > Sent: Thursday, November 21, 2002 2:50 PM
> > Subject: Re: urgent - servlet not found.
> > >
> > > <form method="post" name=indexForm action="servlet/Router" >
> > >
> > > You might also need to add a '/' in front of 'servlet', depending on
how
> > > you set up your server.xml.
> > >
> > > The '<servlet-name>' directive tells Tomcat what alias to give to the
> > > '<servlet-class>'. You could do the full path, but looks better to the
> > > client to use the alias.
> > >
> > > Ben Ricker
> > > Wellinx.com
> > >
> >
> >
> > If i change it to servlet/Router the error is a 404 with
> > description The requested resource (/osp/servlet/Router) is not
available.
> >
> > If i change it to /servlet/Router the error is a 404 with
> > description The requested resource (/servlet/Router) is not available.
> >
> > The server.xml file hasthe entry
> >
> >   <Context path="/osp" docBase="osp" debug="0" reloadable="true" />
> >    <Logger className="org.apache.catalina.logger.FileLogger"
> >                      prefix="osp_" suffix=".txt"
> >            timestamp="true"/>
> >
> > Should I try to remove the servlet from the package com.osp.servlet and
try
> > something.
>
> Remove "servlet" from the JSP. Or, you can change the 'path=' in the
> Context statement in server.xml to '/osp/servlet' (one or the other
> might be more convenient, depending on how many JSP use "/osp/servlet"
> What the 'path=' parameter says is that all requests that begin with
> '/osp/*' are to be parsed as requests for servlets. It then goes through
> the web.xml (this is simplified) for the servlet-name and then for the
> class that name is aliased to. Then, it executes it if it can find it.
> If it cannot, it throws the 404.
>
> HTH,
>
> Ben Ricker
>
> > How do I get the index.jsp to submit to the servlet. Its taken too
long....
> >
> > Tript
> >
> >
> >
>
>
>
>



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

Reply via email to