• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html vs servlet

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic