This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes got stuck in running my first struts example. help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "got stuck in running my first struts example. help" Watch "got stuck in running my first struts example. help" New topic

got stuck in running my first struts example. help

sonali rao
Ranch Hand

Joined: Nov 03, 2003
Posts: 64
I tried to run my first struts application but did not succeed. I am getting the famous HTTP status 404 error. I am using tomcat 4.1.29 version and struts 1.1 for running this example.
error description: The requested resource (/actions/ is not available.
What went wrong? The following is the source code.
<action path="/actions/register1"
<forward name="success"
<HEAD><TITLE>New Account Registration</TITLE></HEAD>
<H1>New Account Registration</H1>
<FORM ACTION="../actions/" METHOD="POST">
Email address: <INPUT TYPE="TEXT" NAME="email"><BR>
Password: <INPUT TYPE="PASSWORD" NAME="password"><BR>
package coreservlets;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class RegisterAction1 extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
<H1>You have registered successfully.</H1>
(Version 1)

I placed file under classes/coreservlets directory.
[ March 02, 2004: Message edited by: sonali rao ]
Bruno Korcinski

Joined: Jun 03, 2003
Posts: 16
try check web.xml servlet mapping ....should be sopmething like
(check some example)
lee anthony
Ranch Hand

Joined: Jan 23, 2004
Posts: 35
i beleive u got the answer for ur question
but in addition to the same what struts is expecting from web.xml is
in form action do not give the whole path not a good practice instead give the /xx format pateer , which should match the /xx action in sturt config file
i beleive this will help u, for better coding
I agree. Here's the link:
subject: got stuck in running my first struts example. help
Similar Threads
getting ClassNotFoundException
got stuck in running my first struts example. help
Struts Validation
Need help - cannot find resource
The requested method POST is not allowed for the URL