Hello,
I am trying to setup my first Struts 2 project with Spring, Hibernate,
and Tiles (and only my second Struts 2 project). I think I have Spring,
Hibernate, and Tiles all working correctly. I'm using Tomcat 6, with
the newest released versions of Struts, Spring, Hibernate, and Tiles. I
am able to start the server with no error messages. I can also navigate
to the welcome page with no issues. However, I seem to have something
wrong with my Struts setup. When I try to go to an action, I get this
error:
SEVERE: Could not find action or result
There is no Action mapped for namespace / and action name getTerm_input.
- [unknown location]
I'm a total newbie, so it's probably something stupid. Below are my
web.xml and struts.xml configuration files. If someone could look at
them, that would be much appreciated! I can also send any of the other
configuration files if necessary.
Thanks!
Kelly
[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_2_5.xsd" id="WebApp_ID"
version="2.5">
<display-name>TermsTranslator</display-name>
<description>A web application to define translations for
terms</description>
<context-param>
<description>This context parameter specified the name and location
of the Spring root application context file.</description>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<description>This context parameter specifies the name and location
of the Tiles Definitions file.</description>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter>
<filter-name>filterDispatcher</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern> <!-- This can be updated to only
open a session when database things can change. -->
</filter-mapping>
<filter-mapping>
<filter-name>filterDispatcher</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>/WEB-INF/jsp/index.jsp</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/jsp/Error.jsp</location>
</error-page>
<resource-ref>
<description>Anatabase DataSource</description>
<res-ref-name>jdbc/AnatabaseDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</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>
<package name="TermsTranslator" namespace="/" extends="tiles-default">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" default="true"/>
</result-types>
<global-results>
<result name="error"
type="dispatcher">/WEB-INF/jsp/Error.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="error"
exception="java.lang.Throwable"/>
</global-exception-mappings>
<action name="getTerm_*" method="{1}"
class="net.toltech.anatabase.webapp.action.GetTerm">
<result type="redirect-action">displayTerm</result>
<result name="input">getTerm</result>
</action>
<action name="*">
<result>welcome</result>
</action>
</package>
</struts>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]