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.
Hi, 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 Olli
posted 16 years ago
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" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <!-- Action Servlet Configuration --> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<!-- Resources bundle base class --> <init-param> <param-name>application</param-name> <param-value>ApplicationResources</param-value> </init-param>
<!-- Context-relative path to the XML resource containing Struts configuration information --> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param>
<!-- The debugging detail level for this servlet, which controls how much information is logged. --> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet>