struts.xml is like <?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.1.7.dtd"> <struts> <constant name="struts.devMode" value="true" /> <constant name="struts.configuration.xml.reload" value="true"/> <constant name="struts.convention.result.path" value="/jsp" /> <constant name="struts.convention.action.packages" value="my.struts2.example.web.actions" /> <constant name="struts.custom.i18n.resources" value="custom" /> <constant name="struts.i18n.reload" value="false" /> <constant name="struts.locale" value="en_IN" /> <constant name="struts.multipart.maxSize" value="10485760" /> <constant name="struts.multipart.parser" value="jakarta"/> <package name="mypackage" extends="struts-default" namespace="/"> ................... </package> </struts> web.xml is like <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> ............. <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>*.action</url-pattern> </filter-mapping> ............... </web-app> Project structure is like -XYZ.ear| |--xyz.war | |--lib| |- xyz.jar |- struts2-core-2.2.3.1.jar |- struts2-convention-plugin-2.2.3.1.jar |- xwork-core-2.2.3.1.jar |- freemarker-2.3.16.jar | etc (all jars required for struts2)
xyz.jar is containing my struts.xml file xyz.jar contains my Action class as follows. my.struts2.example.web.actions.common //java imports...... @ParentPackage("mypackage") public class HomepageAction extends ActionSupport { public String execute() { return SUCCESS; } } xyz.war contains my jsp for HomepageAction like as follows ...WEB-INF/jsp/common/homepage.jsp With this my server is starting successfully and deployed as expected but when i provide URL like http://localhost:8080/xyz/common/homepage.action Its throwing Struts has detected an unhandled exception: Messages: There is no Action mapped for namespace /common and action name homepage. Stacktraces There is no Action mapped for namespace /common and action name homepage. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org