Struts -Hello World – HTTP Status [404]

I am simply trying to created Hello World Struts Application . I have implemented every possible configuration , Still 404 error didnot resolved .

  1. My Server config and Project Structure

enter image description here
enter image description here

  1. Index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="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">
<html>
<head>
<title>Hello World</title>
</head>
<body>
   <h1>Hello World From Struts2</h1>
   <form action="hello">
      <label for="name">Please enter your name</label><br/>
      <input type="text" name="name"/>
      <input type="submit" value="Say Hello"/>
   </form>
</body>
</html>

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

First of all create a package and move HelloWorldAction.java and Product.java to that package (Good Practice).Then specify path in struts.xml
like: – package name demo.struts

 <action name="hello" class="demo.struts.HelloWorldAction"  method="execute">
            <result name="success">/HelloWorld.jsp</result>
 </action>

Change Struts.xml to struts.xml