I'm developing a Struts application that lets a user query a database
using a JSP page and then returns it in a JSP page. I'm using Struts
1.2.4 on Tomcat 5.0.28. Whenever I try to start the Struts program,
however, I receive this error:
javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection
        
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
        
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
        org.apache.jsp.index_jsp._jspService(index_jsp.java:78)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



root cause javax.servlet.jsp.JspException: Cannot find ActionMappings
or ActionFormBeans collection
        org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:711)
        org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
        org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:94)
        org.apache.jsp.index_jsp._jspService(index_jsp.java:67)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I've searched Google for any information about this error, and I've
found some documentation on this error. I've followed the suggestions
(such as validating that web.xml and struts-config.xml are correct),
and I still get the error. Is there something I'm doing wrong, and if
so, could someone point me to where I should look.
My web.xml file is: 
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4">
  <servlet>
   <servlet-name>action</servlet-name>
   <servlet-class>
     org.apache.struts.action.ActionServlet
    </servlet-class>
   <init-param>
     <param-name>config</param-name>

     <param-value>/struts-config.xml</param-value>
     </init-param>
     <init-param>
        <param-name>host</param-name>
        <param-value>localhost</param-value>
     </init-param>
     <init-param>

        <param-name>port</param-name>
        <param-value>8080</param-value>
     </init-param>
     <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet>
  <servlet-name>freemarker</servlet-name>

  <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
  <!-- FreemarkerServlet settings: -->
  <init-param>
    <param-name>TemplatePath</param-name>
    <param-value>/</param-value>
  </init-param>
  <init-param>

    <param-name>NoCache</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>ContentType</param-name>
    <param-value>text/html</param-value>
  </init-param>

    
  <!-- FreeMarker settings: -->
  <init-param>
    <param-name>template_update_delay</param-name>
    <param-value>0</param-value> <!-- 0 is for development only! Use
higher value otherwise. -->
  </init-param>
  <init-param>
    <param-name>default_encoding</param-name>

    <param-value>ISO-8859-1</param-value>
  </init-param>
  <init-param>
    <param-name>number_format</param-name>
    <param-value>0.##########</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>

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

<taglib>
<taglib-uri>struts-logic.tld</taglib-uri>
<taglib-location>
  struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-html.tld</taglib-uri>
<taglib-location>
  struts-html.tld</taglib-location>
</taglib>

  <session-config>
    <session-timeout>
            30
        </session-timeout>
  </session-config>
  <welcome-file-list>
    <welcome-file>
        index2.jsp        
        </welcome-file>
  </welcome-file-list>

</web-app>
 
and my struts-config.xml file is: 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

<struts-config>
   
    <form-beans>
     <form-bean name="DatabaseRetrievalActionForm"
type="DatabaseRetrievalActionForm"/>
     </form-beans>
 
    <global-forwards>
        <forward name="intro" path="/index.jsp"/>
    </global-forwards>
    
    <action-mappings>

        <action path="/DatabaseRetrievalAction"
type="DatabaseRetrievalAction" input="/index2.jsp"
name="DatabaseRetrievalActionForm"  scope="request">
            <forward name="success" path="/DatabaseRetrievalResults.ftl"/>
        </action>
    </action-mappings>
</struts-config>

Thanks for your time.

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

Reply via email to