Web Hosting Talk







View Full Version : small tomcat question, Jsp works servlets dont


mpkapadia
08-27-2001, 12:42 PM
Hello all ,

I have installed tomcat on my machine

my server.xml reads something like

<Host name="www.domainname.com">
<Context path="" docBase="/usr/local/plesk/apache/vhosts/domain.com/httpdocs" debug="0"/>
</Host>

In my httpsd.conf i have
Jkmount /servlet/* ajp13
JkMount /*.jsp ajp13

My problem

www.domainname.com/*.jsp RUN FINE
where do i upload servlets

I created a servlet folder in the docbase and run

www.domainname.com/servlet/ServletName and It gives me 404 error , Page not found

what error i have made here,
Finally after lots of problems my tomcat is about to work on a plesk box, so just need last bit of advise here

Regards
Manish Kapadia

Palm
08-27-2001, 04:03 PM
You need to load the servlet which usually ends with .class
into an HTMl file. There is special syntax to use for that, not sure which one.

mpkapadia
08-27-2001, 04:19 PM
Hi

I thought servlets were always accessed by sitename.com/servlet/ServletName
where ServletName.class is the file name,

I am doing like this on another server on apache jserv

How can i embedd .class file into a .html as you have said here
can u give some more information

As i have stated my jsp files are working perfect and also my jdbc database connectivity

Regards
Manish Kapadia

jnestor
08-27-2001, 05:01 PM
Palm is confusing servlets and applets. Applets get called from a .html file.

Servlets do get called as you said. Sort of.

Tomcat has made everything very "flexible" and hence complicated. There's a whole directory structure you need to create. Look under the webapps directory where tomcat is installed for some examples. And read the documentation :)

mpkapadia
08-27-2001, 05:46 PM
jnestor

I tried to create paths like /examples/servlet and placed the class file within that but still does not work

THis is really annoying jsp working and not servlets

Ok in the following
<Host name="www.domainname.com">
<Context path="" docBase="/usr/local/plesk/apache/vhosts/domain.com/httpdocs" debug="0"/>
</Host>

Does anyone know what is Context path="" for ?

Please help me

Regards
Manish Kapadia

Palm
08-27-2001, 06:19 PM
Originally posted by jnestor
Palm is confusing servlets and applets. Applets get called from a .html file.

Servlets do get called as you said. Sort of.

Tomcat has made everything very "flexible" and hence complicated. There's a whole directory structure you need to create. Look under the webapps directory where tomcat is installed for some examples. And read the documentation :)

Actually I am not.
When I wanted to run servlets, I always called them through HTML, and it worked good.

mpkapadia
08-28-2001, 12:36 AM
Palm

If you have done it that way please can you tell me how?

Regards
Manish Kapadia

Palm
08-28-2001, 12:51 PM
I lost the page that has a tutorial, I could try to find out.

mpkapadia
08-29-2001, 01:56 AM
Hi

I finally managed to get it working

jnestor - your advise was helpful , indeed the paths were to be created.
I had to make WEB-INF/classes within Docbase

and anything within classes could be accessed as /servlet/ServletName

Also checked for jdbc connectivity to mysql and that too was satisfactory , luckily,

But i am not sure if we should support tomcat for our hosting customers.
Tomcat is really a pain.

regards
Manish kapadia