• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

problem in Struts2 while running an application  RSS feed

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="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_3_0.xsd"
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" "http://www.w3.org/TR/html4/loose.dtd">
<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
| | | | | HelloWorld.java
| | |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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!