tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Propes, Barry L " <barry.l.pro...@citi.com>
Subject RE: 404 message when trying to test a servlet
Date Tue, 29 May 2007 16:40:42 GMT
servlet mapping entails which directory you would like your classes to be or to be named, and
where the actual servlet will be.
Also, will it be mapped to a different name? That's typically a good idea, from what I've
read.

i..e here's a blurb from the web.xml file what servlet mapping would look like.

<servlet-mapping>
<servlet-name>chngctrl.ChangeControlUserAcctServletSPCall</servlet-name>
 <url-pattern>/chngctrl/ChangeControlUsersSP.jsp</url-pattern>
</servlet-mapping>      

that JSP you see is a "fake jsp" the file doesn't exist but that's where the action file from
the form points. It actually calls the servlet instead, under the hood.

But further up the page, you have to declare the servlet name, i.e.

   <servlet>  
           <servlet-name>chngctrl.ChangeControlUserAcctServletSPCall</servlet-name>
           <servlet-class>chngctrl.ChangeControlUserAcctServletSPCall</servlet-class>
  </servlet> 

you could make a different name for your class from your servlet if you wanted, but I think
most people don't...probably too confusing in the long run.

-----Original Message-----
From: Dean [mailto:dwagstaff@nctv.com]
Sent: Tuesday, May 29, 2007 11:23 AM
To: 'Tomcat Users List'
Subject: RE: 404 message when trying to test a servlet


Thanks for the info.  However, I am new to tomcat and servlets and as such
am still somewhat unclear as to the resolution to this problem.  Can you
clarify.  What exactly is servlet - mapping?

Thanks,

D

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Bill Barker
Sent: Saturday, May 26, 2007 8:06 PM
To: users@tomcat.apache.org
Subject: Re: 404 message when trying to test a servlet


"Dean" <dwagstaff@nctv.com> wrote in message 
news:9B.C0.08653.55DC8564@mxo5.broadbandsupport.net...
> Greetings,
>
>
>
> I suspect the class file may be in the wrong directory.  I get the message
> /basic-servlet/servlet/CurrencyConverter  , which is confusing in that the
> class file is in the following directory C:\Program Files\Apache Software
> Foundation\Tomcat 4.1\webapps\basic-servlet\WEB-INF\classes.  The html 
> page
> is being found ok but when I do a submit and it tries to bring up the
> servlet I get the above.
>

The invoker servlet has been disabled in the default config for ages 
(because it is evil :).  You can enable it at your own risk in conf/web.xml,

but that isn't recommended.  Use an explicit servlet-mapping instead.

Having classes in the default package will prevent you from upgrading later 
on.  You really should put your class in a package.

>
>
> I really appreciate any help you can give.
>
>
>
> P.s. when I start tomcat I only get the following messages
>
> Starting service Tomcat-Standalone
>
> Apache Tomcat/4.1.36-LE-jdk14
>
>
>
> I am able to access http://localhost:8080/index.jsp
>
>
>
> Sincerely,
>
>
>
> D
>
>
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message