I'm sure I have a simple error here, but I don't see it.

I'm trying to construct a simple "hello, world" app with v2.0.11.  I
have an "index.jsp" that redirects to "main.action".  I started out with
the "main" action just having a result (name="success") going to
"/main.jsp".  That appears to work.  I then cloned the action (and
changing the name), adding a "class" attribute referring to a simple
Action class.  The Action class' execute method just returns SUCCESS.  I
would have thought this would do the same thing as the action without
the Action class, but it instead fails with "No result defined for
action com.wamu.struts.helloworld.MainAction and result success".

I'll attach my struts.xml, web.xml, and MainAction.java files.
<?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-helloworld</display-name>

  <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
  </filter>

  <filter>
    <filter-name>struts</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    <init-param>
      <param-name>actionPackages</param-name>
      <param-value>com.wamu.struts.helloworld</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <listener>
    <listener-class>
      org.springframework.web.context.ContextLoaderListener
    </listener-class>
  </listener>

  <servlet>
    <servlet-name>JspSupportServlet</servlet-name>
    <servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <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>
</web-app>
<?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">
    <interceptors>
      <interceptor-stack name="stack">
        <interceptor-ref name="defaultStack" />
      </interceptor-stack>
    </interceptors>
    <action name="main" class="com.wamu.struts.helloworld.MainAction">
      <result name="success">/main.jsp</result>
    </action>
    <action name="main2">
      <result name="success">/main.jsp</result>
    </action>
  </package>
</struts>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to