struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Eclipse WTP / Struts 2 - Not working!!
Date Wed, 11 Apr 2007 21:06:11 GMT
Hi all

This problem has been driving me crazy and I know that it should be a 
simple problem. I have already posted this in this mailing list, but a 
simply configuration issue is stopping my development work!! Please help.

There is a reason why I post this in the struts mailing list because a 
non-struts web application works fine with Eclipse WTP.

I have written the simplest struts-enabled HelloWorld application. It 
works fine if I deploy it directly to the Tomcat server. But I get a 404 
error while configuring it with Eclipse WTP.

Below is my configuration:
Java - 1.4.2_13
Tomcat 5.5.23 with Java 1.4 compatible jars
Struts 2.0.6 with Java 1.4 compatible jars
Eclipse WTP 3.2.2

I created a new "dynamic web project" with Tomcat 5.5 as runtime, "test" 
as "context root" and "WebContent" as "Content Directory". I copied the 
struts jars to the "WebContent/WEB-INF/lib" folder. The jsp files are 
placed in "WebContent/WEB-INF/jsp" folder.

The following is my folder structure:
+ WebContent
   - + classes
      - struts.xml
   - + jsp
   - + lib
   - + src
   - web.xml

Following are my codes:


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" 



    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

        <!-- Configuration for the default package. -->
        <package name="default" extends="struts-default">
                <action name="HelloWorld" class="gov.epa.r5sis.HelloWorld"

package gov.epa.r5sis;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {

        private static final long serialVersionUID = 1L;
        public static final String MESSAGE = "Hello World! Struts is up 
and running ...";

    public String execute() throws Exception {
        return SUCCESS;

    private String message;

    public void setMessage(String message){
        this.message = message;

    public String getMessage() {
        return message;


<%@ page contentType="text/html; charset=iso-8859-1" language="java" 
import="java.sql.*" errorPage="" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <title>Hello World!</title>

<h2><s:property value="message" /></h2>


When I run the application by using "run on server" option, the tomcat 
server starts without a problem and opens the url "http://localhost
:8080/test/" in the browser. "http://localhost
:8080/test/HelloWorld.action" gives a 404 error. But the same application 
deployed directly in Tomcat, works fine!!

Please help.

Vignesh Manickam Periaswamy
Web Application Developer Intern, Information Management Section
WPTD,   EPA Region 5         312-886-0887

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message