Reputation: 6715
I have been developing my first simple application. I have included all the necessary libraries into the WEB_CONTENT/WEB_INF/lib in order to run a basic struts application. But when i open the url it shows:
The requested resource (/StrutsStarter/getStarter.action) is not available.
I have no idea why it is not working properly because since the dubug gives no error. Any help would be appreciated.
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_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>StrutsStarter</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>success.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"></constant>
<package name="default" extends="struts-default">
<action name="getStarter" class="org.aars.action.StarterAction">
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
StarterAction
package org.aars.action;
public class StarterAction {
public String execute(){
System.out.println("StarterAction Executed");
return "success";
}
}
I added these jars
Thanks in advance.
Upvotes: 2
Views: 3813
Reputation: 6715
Finally i found the answer.
I just added one more jar commons-lang3-3.1.jar
to build path makes it work.
Upvotes: 2