This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem in running Struts tutorial example by Isabelle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in running Struts tutorial example by Isabelle " Watch "Problem in running Struts tutorial example by Isabelle " New topic

Problem in running Struts tutorial example by Isabelle

C Wong

Joined: May 28, 2002
Posts: 18
I am new to Struts. I followed the Jakarta Struts - A beginner's tutorial by Isabelle but have a problem in running the first example.
I should see a directory listing with files by entering http://localhost:8080/registeruser/
The error message:
HTTP Status 404 - /registeruser/
type Status report
message /registeruser/
description The requested resource (/registeruser/) is not available.
My Tomcat Apache Tomcat/4.1.18 is working fine. I could use it to run other examples.
I am not using Eclipse but I have created:
the index.jsp in webapps\registeruser
web.xml in webapps\registeruser\WEB-INF.
The struts.jar is copied to \webapps\registeruser\WEB-INF\lib.
I would appreciate if someone could help me to solve this problem in order to continue with the tutorial.
Thank you in advance.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
it looks like you didn't map the StrutsController Servlet to /registeruser/.
Normaly you can do it two ways:
- Map this Servlet to a certain path e.g. /do/* now every request to this URL is handled by the servlet
- or map an ending to the servlet /*.do
But anyway one of these configurations has to be done.
Then it should work
If it is still not working, please post your web.xml and struts-config.xml
C Wong

Joined: May 28, 2002
Posts: 18
Hi Olli, according to the tutorial (at section: Learning by example: your first Struts application), there is no mention of struts-config.xml yet. However, the web.xml has a reference to it. That could be the cause of problem that Tomcat could not create a web application called "registeruser". I still have a same problem after creating the struts-config.xml.
---- web.xml -------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
<!-- Action Servlet Configuration -->

<!-- Resources bundle base class -->

<!-- Context-relative path to the XML resource containing Struts configuration information -->

<!-- The debugging detail level for this servlet, which controls how much information is logged. -->

<!-- Action Servlet Mapping -->

<!-- The Welcome File List -->
<!-- Application Tag Library Descriptor -->
<!-- Struts Tag Library Descriptors -->

------ struts-config.xml --------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
<!-- Logon form bean -->
<form-bean name="loginForm"

<forward name="mainmenu" path="/mainmenu.jsp" />

<!-- Process a user logon -->
<action path="/login"

I agree. Here's the link:
subject: Problem in running Struts tutorial example by Isabelle
It's not a secret anymore!