• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem in running Struts tutorial example by Isabelle

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"

Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic