File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html vs servlet

 
Naveed Ali
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Jawan Reshman
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
and you your index.html will be displayed when accessed by
http://<yourhost>:<yourport>

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic