Struts 2 hello world example index.jsp 404 error

I am done with googling but i didnot receive any help from there.
I am following the link http://www.tutorialspoint.com/struts_2/struts_examples.htm
and trying to open simple index.jsp page.
while doing so i am receiving the error

HTTP Status 404 – /HelloWorldStruts2/index.jsp


type Status report

message /HelloWorldStruts2/index.jsp

description The requested resource (/HelloWorldStruts2/index.jsp) is
not available.


Apache Tomcat/7.0.12

my web.xml file is:

<?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>Struts 2</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.ng.filter.StrutsPrepareAndExecuteFilter
      </filter-class>
   </filter>

   <filter-mapping>
      <filter-name>struts2</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>
</web-app>   

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="" 
           >
            <result >/index.jsp</result>
      </action>
      <action name="hello" 
            class="com.tutorialspoint.struts2.HelloWorldAction" 
            method="execute">
            <result name="success">/HelloWorld.jsp</result>
      </action>
   </package>
</struts>

Tomcat stacktrace:

[![Sep 03, 2015 12:52:39 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.8.0_31bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:/Program Files/Java/jre1.8.0_31/bin/client;C:/Program Files/Java/jre1.8.0_31/bin;C:/Program Files/Java/jre1.8.0_31/lib/i386;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:Program FilesIBMPersonal Communications;C:Program FilesIBMTrace Facility;C:Program FilesJavajdk1.8.0_25bin;C:Users6278DesktopPOI;C:Eclipse IDE  for Java EE Developers 4.4;;.
Sep 03, 2015 12:52:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWorldStruts2' did not find a matching property.
Sep 03, 2015 12:52:39 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 03, 2015 12:52:39 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 03, 2015 12:52:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 477 ms
Sep 03, 2015 12:52:39 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 03, 2015 12:52:39 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Sep 03, 2015 12:52:39 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [151] milliseconds.
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts.xml]
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Overriding property struts.i18n.reload - old value: false new value: true
Sep 03, 2015 12:52:40 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Overriding property struts.configuration.xml.reload - old value: false new value: true
Sep 03, 2015 12:52:40 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 03, 2015 12:52:40 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 03, 2015 12:52:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1082 ms][1]][1]

image of my project explorer:


Source: jsp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.