Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Configuring tomcat 6 with eclipse to serve servlets and jsp/html.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

First of all, thank you very much for any assistance that you might be able to offer.

I am trying to setup Tomcat 6 to work with Eclipse (Build id: 20090621-0832). I am relatively new with eclipse but have used tomcat in the past with JBoss. I have installed the tomcat server within eclipse and have been able to configure it to handle a couple of servlets that I have developed.

What I cannot figure out is how to get it to make simple jsp and html files available via the web browser. I have tried putting simple files in various locations, but tomcat continues to respond with 404 errors.

The following is a summary of my basic directory structure:

C:\Program Files\eclipse\plugins\apache-tomcat-6.0.20\webapps\ROOT
C:\Program Files\eclipse\workspace\MyWebApp\WebContent

The following is my web.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>MyAppName</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description />
<display-name>AppletBuilder</display-name>
<servlet-name>AppletBuilder</servlet-name>
<servlet-class>com.company.application.server.facade.AppletBuilder</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<description />
<display-name>XmlRpcManager</display-name>
<servlet-name>XmlRpcManager</servlet-name>
<servlet-class>com.company.application.server.xmlapi.XmlRpcHandlerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AppletBuilder</servlet-name>
<url-pattern>/MyAppName/AppletBuilder</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>XmlRpcManager</servlet-name>
<url-pattern>/MyAppName/XmlRpcManager</url-pattern>
</servlet-mapping>
</web-app>

To access the servlets, I have been using http://localhost/MyWebApp/MyAppName/AppletBuilder or http://localhost/MyWebApp/MyAppName/XmlRpcManager, which appears to be working as expected. Where should I be putting the physical welcome files and what url should I use to access them? I was trying to use something like http://localhost/MyWebApp/index.jsp.

Any assistance would be HUGELY appreciated !!!

Thank you,
Sam
 
Popeye has his spinach. I have this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!