File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes html vs servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "html vs servlet" Watch "html vs servlet" New topic

html vs servlet

Naveed Ali
Ranch Hand

Joined: Aug 30, 2002
Posts: 41
I have just created a small seperate web application (given to it a eperate context path in server.xml) for Tomcat 4.0 and Win2000. I can successfuly call my servlet but can't the html file. I want to load the html file first through URL and then call this servlet from html file. How can i do it??? I am sure how to call it from within html file atleast. The directory structure is,
servlet class placed in /application/WEB-INF/classes/classes
index.html placed in /application/
web.xml placed in /application/WEB-INF/
Are any changes required in web.xml file regarding index.html instead of servlet mapping etc.?? I have mapped servlet successfuly and is running.
The /application directory is under the /webapps directoy of Apache Tomcat installation directory.
Ivan Matmati
Ranch Hand

Joined: Feb 26, 2003
Posts: 41
Your html file should be called with http://host : port/context/index.html.
Have you tried this?What is your log saying then?
[ April 22, 2004: Message edited by: Ivan Matmati ]

No Gates!<p>SCPJ 1.4<br />SCWCD 1.4
Jawan Reshman

Joined: Apr 01, 2004
Posts: 4
There are two solutions to your problem
1. (As suggested by Ivan Matmati in his reply).
Access your page as following.
http://<your host>:<your port>/context/index.html
2. Decalare in web.xml
and you your index.html will be displayed when accessed by

Hope this helps.
I agree. Here's the link:
subject: html vs servlet
jQuery in Action, 3rd edition