jsp - resource not available in struts2 -
i new struts have developed first struts application using struts 2.3.15 , apache 7.0.42 when running following code saying requested resource not available
my code snippets are:
struts.xml
<?xml version="1.0" encoding="utf-8"?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.3//en" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package name="default" namespace="/" extends="structs-default"> <action name="gettutorial" class="org.shekhar.javabrains.action.tutorialaction"> <result name="success">/success.jsp</result> <result name="failure">/error.jsp</result> </action> </package> </struts>
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" 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"> <display-name>struts2starter</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.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>
tutorialaction.java
package org.shekhar.javabrains.action; public class tutorialaction { public string execute() { system.out.println("hello execute"); return "success"; } }
success.jsp
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!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>insert title here</title> </head> <body> success page! </body> </html>
error.jsp
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!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>insert title here</title> </head> <body> error occured! </body> </html>
list of jarfiles have added code
commons-fileupload-1.3.jar commons-io-2.0.1.jar commons-logging-1.1.3.jar commons-logging-api-1.1.jar freemarker-2.3.19.jar javassist-3.11.0.ga.jar ognl-3.0.6.jar struts2-core-2.3.15.1.jar xwork-core-2.3.15.1.jar commons-lang3-3.1.jar
could please me resolve problem
can 1 me solve problem
Comments
Post a Comment