You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Keith Barron <ke...@java-genius.com> on 2000/06/12 19:14:46 UTC

Q: *.do file

My little test application doesn't work. Can someone point out what I'm
missing.

================
In WEB-INF/classes:
--------------
Action class, called OneAction.class (a slimmed down version of the
"LogonAction" class the comes w/ struts-example, except that it just
returns success)

ApplicationMapping.class (same one that comes w/ the struts-example)

ApplicationResources.properties (has the text for "index.one-do", seen
below in the index.jsp)
================


================
In WEB-INF/lib:
--------------
struts.jar
================


============
In WEB-INF:
-----------
action.xml, which looks like this:

   <action-mappings>
        <action     path="/one"
             actionClass="OneAction"
                    success="/success.jsp"
                    failure="/failure.jsp"
         />
   </action-mapping>

struts.tld

web.xml (same one that comes w/ the struts-example)
=============

=============
In test3 (the name of my application)
------------
3 JSP files:

index.jsp, which looks like this:

  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
  <html>
  <body bgcolor="white">
  <struts:link href="one.do"><struts:message
key="index.one-do"/></struts:link>
  </body>
  </html>

success.jsp, which looks just like index.jsp except basically just shows
"Success"

failure.jsp, which just basically shows "Failure"
==============

When I go to the URL "http://localhost:8080/test3/index.jsp", I get the
index.jsp page. OK so far. Then when I click on the one and only link on
that page, I get an Error:404: Location: /test3/one.do

I've tried to follow the "struts-example". I obviously don't understand
the relationship between my OneAction.class and the action servlet,
which I thought would be linked by the "action.xml" file in the same
way.

Any help is appreciated.

-Keith