Click here to Skip to main content
12,068,967 members (65,721 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: struts Eclipse
I want to devolop a simple STRUTS helloworld application using struts framework in ECLIPSE
I was getting RESOURCE NOT FOUND ERROR

I have created XML files ,and Saction servelets ,view pages as follows

index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="s" uri="http://jakarta.apache.org/struts/tags-html"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello World</title>
</head>
<body>
<h1>Hello world</h1>
<form action="hello">
<label for="name">Please enter your name</label><br/>
<input type="text" name="name"></input>
<input type="submit" value="sayhello"></input>
</form>
</body>
</html>
and this is for HelloWorld.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
   
    <%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Hello world</title>
</head>
<body>
hello world <s: property value="name"/>
</body>
</html>

and struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
   "http://struts.apache.org/dtds/struts-2.0.dtd">
   <struts>
   <constant name="struts.devmode" value="true" />
   <package name="HelloWorld" extends="struts-default">
   
   <action name="hello" class="com.tutorialspoint.struts2.HelloWorldAction"  method="execute">
   <result name="success" >/HelloWorld.jsp</result>
   </action>
   </package>
   </struts>

and 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_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>HelloWorldStruts2</display-name>
  <welcome-file-list>
    
    <welcome-file>index.jsp</welcome-file>
    
  </welcome-file-list>
  <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.Dispatcher.FilterDispatcher</filter-class>
  </filter>
  
  <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
  
  
</web-app>

Please tell me what was the wrong in it..

And i was getting error as

type Status report
message 
description The requested resource is not available

please tell me the solution
Posted 7-Feb-13 0:14am
Edited 7-Feb-13 3:38am
TorstenH.34.8K
v2
Comments
Richard MacCutchan 7-Feb-13 5:26am
   
Where does this message appear? Does it indicate the file and line number that caused it?
vinod.sambangi 7-Feb-13 7:22am
   
no not exactly but it was saying in begining itself
in localhost browser
TorstenH. 7-Feb-13 8:39am
   
There is no Java in this. not a single bit at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160208.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100