> -----Original Message-----
> From: Lubos Vrba [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 09, 2001 1:32 PM
> To: Tomcat (E-mail)
> Subject: Problem with configuring Tomcat
>
> Hello I'm really a newbie I need your help
> I installed tomcat and try to run examples and it worked fine.
> I also tried to build my servlet that runs in JServ into Tomcat but I
> failed. I think I completely misunderstand the configuration..
> Here are steps I made:
> 1. I add this to TOMCAT_HOME/conf/server.xml
> <Context path="/examples/myExample"
> docBase="myExample"
> defaultSessionTimeOut="30"
> isWARExpanded="true"
> isWARValidated="false"
> isInvoverEnabled="true"
> isWorkDirPersistent="false"
> />
>
> 2. I create directories TOMCAT_HOME/examples/myExample/WEB-INF/classes and
> put my classes there
> it's in i/first/MyFirst.class
> 3. I put web.xml to TOMCAT_HOME/examples/myExample/WEB-INF
> it looks:
> <servlet>
> <servlet-name>
> MyStart
> </servlet-name>
> <servlet-class>
> i.first.MyStart
> </servlet-class>
> <load-on-startup>
> -2147483646
> </load-on-startup>
> </servlet>
> ...
>
> 4. I restart tomcat and into browser I typed
> http://lmyhost:myport/examples/myExample/MyStart but it returns 404 error.
> What am I doing bad?
>
> Thanks for any hint in advance,
> Lubos Vrba
>
[Kitching Simon]
The <servlet-name>tag doesn't define what URL causes the servlet to
be run;
that is the purpose of the <servlet-mapping> tag - which you haven't
created.
Add something like this to your web.xml file:
<servlet-mapping>
<servlet-name>
MyStart
</servlet-name>
<url-pattern>
/UrlForMyStart
</url-pattern>
</servlet-mapping>
You should then be able to access
http://lmyhost:myport/examples/myExample/UrlForMyStart
>
Of course, if you defined the url-pattern as /MyStart, then the
original url you wanted would work; I'm just demonstrating above
that the url doesn't have to be the same as the servlet-name. In
fact, if you want to, you can define multiple URLs that map to
the same servlet.
Everything else you're doing looks ok to me.
Regards,
Simon
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]