Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Java
<%@ 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

Java
<%@ 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
Java
<?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
Java
<?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

Java
type Status report
message 
description The requested resource is not available


please tell me the solution
Posted
Updated 7-Feb-13 2:38am
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900