Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

problem in Struts2 while running an application

Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Guys!!!

I know struts 1.3 but new in struts2 so i am creating hello world application on struts2 using eclipse(Indigo) with apache tomcat 7

but get an error like

HTTP Status 404 - /struts2/


type Status report

message /struts2/

description The requested resource (/struts2/) is not available.


Apache Tomcat/7.0.14

this is my struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<package name="default" extends="struts-default" namespace="/">
<action name="HelloWorld" class="com.controller.HelloWorld">
<result name="SUCCESS">/success.jsp</result>

this is my Action Support class
package com.controller;

import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport{
String message ;
String userName ;
public String getUserName() {
return userName;
public void setUserName(String userName) {
this.userName = userName;
public String getMessage() {
return message;
public void setMessage(String message) {
this.message = message;
public String execute(){
setMessage("Hello " + getUserName()) ;
return "SUCCESS";

this is my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="";
xmlns=""; xmlns:web="";
id="WebApp_ID" version="3.0">

this is my index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">;
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<s:form action="HelloWorld">
<s:textfield name="userName" label="User Name:"></s:textfield>

this is my hierarchy

| | Java Resources
| | |src
| | | | com.controller
| | | | |
| | |resources
| | | | struts.xml
| | build
| | WebContent
| | |WEB_INF
| | | | lib
| | | | | web.xml
| | |index.jsp
| | |success.jsp

Pl help me out

Software Engineer
Posts: 9
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if you take a look at Tomcat web application manager, can you see you application and does Tomcat says it's running ?

You'll find here some explanations on how to enable Tomcat Web App manager for tomcat 5.5, I guess it's pretty much the same for Tomcat 7

And please use BB code to display your codes, xml files, ... such as :
Ishant Agarwal
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your support but i am using an eclipse browser and still getting an same kind of error
Franck Times
Posts: 9
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a browser issue, rather a server issue. Your app is not found either because:
you did not properly deployed it on Tomcat
or your configuration (web.xml and/or struts.xml) is not valid.

Looking at the Tomcat web app manager would allow you to check if your app was deployed or not, ruling out one of the two possibilities.

Tomcat web app manager is a Tomcat feature which enables you to have a look on what's running on your tomcat server. You said you were using tomcat 7. I guess (I am using tomcat 6) there's a web app manager in T7. Usually you can access it thru : http://localhost:8080/manager/html.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic