aspose file tools*
The moose likes Tomcat and the fly likes Configuring tomcat 6 with eclipse to serve servlets and jsp/html. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Configuring tomcat 6 with eclipse to serve servlets and jsp/html." Watch "Configuring tomcat 6 with eclipse to serve servlets and jsp/html." New topic
Author

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

Sam Garvey
Greenhorn

Joined: Nov 16, 2009
Posts: 1
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Configuring tomcat 6 with eclipse to serve servlets and jsp/html.