hello Jaime,

The described error I've seen twice, each resulting from failed parsing of
struts-config.xml, i saw it when i tried to initialize a data source.  The
failed initiation prevented the ActionMappings or ActionFormBeans from being
properly initialized (or recognized) later in the file.

Think of the few changes you've made to the example's config, or otherwise
focus on your struts-config.xml (check for </closing tags>).  Perhaps
somebody else knows a xml tool that can analyze the file and point out the
error for you.

soon you'll be strutting around,

Loren



-----Original Message-----
From: Jaime Marcondes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 4:12 AM
To: [EMAIL PROTECTED]
Subject: Cannot use ActionBeans - Error "cannot find ActionMappings or
ActionFormBeans"


Hello, All.

    I'm a new in the struts framework and i tried to make a little project
using this framework, but when i try to use a actionbean, it says:

"org.apache.jasper.JasperException: Cannot find ActionMappings or
ActionFormBeans collection ..."

    The web.xml:
===================
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>

<!-- Servlet used by application -->
<servlet>
  <servlet-name>Book</servlet-name>
  <servlet-class>teste.struts.Book</servlet-class>
</servlet>

<servlet>
  <servlet-name>BookAction</servlet-name>
  <servlet-class>teste.struts.BookAction</servlet-class>
</servlet>

<!-- Action Servlet Configuration -->
<servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
  <init-param>
  <param-name>application</param-name>

<param-value>org.apache.struts.webapp.example.ApplicationResources</param-va
lue>
  </init-param>
  <init-param>
  <param-name>config</param-name>
  <param-value>/WEB-INF/struts-config.xml</param-value>
  </init-param>
  <init-param>
  <param-name>debug</param-name>
  <param-value>2</param-value>
  </init-param>
  <init-param>
  <param-name>detail</param-name>
  <param-value>2</param-value>
  </init-param>
  <init-param>
  <param-name>validate</param-name>
  <param-value>true</param-value>
  </init-param>
  <load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

<servlet-mapping>
  <servlet-name>Book</servlet-name>
  <url-pattern>/Book</url-pattern>
</servlet-mapping>

<servlet-mapping>
  <servlet-name>BookAction</servlet-name>
  <url-pattern>/BookAction</url-pattern>
</servlet-mapping>

<welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<!-- Struts Tag Library Descriptors -->
<taglib>
  <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
  <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
  <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
  <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

</web-app>


The struts-config.xml
=======================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd";>

<struts-config>
 <form-beans>
   <form-bean name="bookForm"
              type="teste.struts.Book"/>
 </form-beans>

 <global-forwards>
   <forward name="bookCreated" path="/BookView.jsp"/>
 </global-forwards>

 <action-mappings>
   <action path="/createBook">
     type="teste.struts.BookAction"
     name="bookForm"
     scope="request"
     input="/CreateBook.jsp">
   </action>
 </action-mappings>

</struts-config>


The BookView.jsp
=================
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld"  prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html:html locale="true">
 <head>
   <html:base/>
   <title>Teste</title>
 </head>

 <body>
   <h2>BookView</h2>

   <html:form action="/createBook" method="GET">
     Title:<html:text property="title" /> <br/>
     <html:submit property="submit"/>
   </html:form>
 </body>

</html:html>


I don't know what is wrong, since this is a test from the faq of struts,
which i modified to
learn.

Thanks for help,

Jaime



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to