Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot find ActionMappings or ActionFormBeans collection

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen two or three messages with the same error but it seems as if no one has found the solution. Here's my stats:

I'm running a localhost using JRun 4. I've installed Struts 1.2.4 and created the "simple" app posted at: Macromedia JRun TechNotes: JRun 4.0: Jakarta Struts

The tutorial was written for Struts 1.1. The only change I made was changing the reference to struts-form.tld to struts-html.tld in the index.jsp file.

My directory structure is:
JRun4.0
|
+-- servers
|
+-- default
|
+-- foo
| |
| +-- WEB-INF
| |
| +-- classes
| | |
| | +-- com
| | |
| | +-- struts
| | +-- ActionForward.class
| | +-- SessionForm.class
| +-- lib
| | +-- struts.jar
| | +-- struts-el.jar
| |-- struts-config.xml
| |-- struts-html.tld
| |-- struts-html-el.tld
| |-- web.xml
|-- index.jsp
|-- Output.jsp
|-- Failure.jsp


The line in the index.jsp file that is throwing the error is the second line below:

1 <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
2 <html:form action="logon.do">
3 UserName: <html:text property="username" />
4 Password: <html:password property="password" />
5 <html:submit value="Logon" />
6 </html:form>

If I delete lines 2 and 6, I get the error: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope.

Any Ideas?

[ October 07, 2004: Message edited by: James Lopez ]

[ October 07, 2004: Message edited by: James Lopez ]
[ October 07, 2004: Message edited by: James Lopez ]
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just went through the same thing getting it set up on tomcat. Try adding all the jar files that came with struts. Think the struts.jar makes use of some of them.
 
James Lopez
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,
thanks for the suggestion. There were actually multiple things wrong with the original example:

index.jsp
1. Used the struts-form.tld library.
2. Defined the action as "logon.do" but defines the actions-mappings/action path in struts-config.xml as "/input".

JAR files
1. Did not direct user to copy either the struts-el.jar or the common jar files to WEB-INF/lib

Library Files
1. Directed user to copy struts-form.tld file instead of the struts-html-el.tld file to WEB-INF directory.

SessionForm class (the Action Form)
1. Directed class be put in WEB-INF/lib/com/struts directory

ActionForward class (the Action )
1. Directed class be put in WEB-INF/lib/com/struts directory
2. Used the "perform" method instead of the "execute" method.

status-config.xml
1. Defined DOCTYPE as struts-config_1_0.dtd instead of struts-config_1_1.dtd.
2. Forgot the closing slash for the form-bean tag.
3. Defined the actions-mappings/action path in struts-config.xml as "/input" but defined the action as "logon.do" in index.jsp.

Here's how I resolved the issues in the TechNote: "JRun TechNotes:Jrun 4.0: Jakarta Struts and JRun 4" ( http://www.macromedia.com/support/jrun/ts/documents/tn18297.htm )

1. Created the following directories under the web-app root:
- WEB-INF
- WEB-INF/classes/com/struts
- WEB-INF/lib
- WEB-INF/

2. Copied the following JARs to WEB-INF/lib:
From the {STRUTS}/lib dirctory:
- commons-beanutils.jar
- commons-collections.jar
- commons-digester.jar
- commons-fileupload.jar
- commons-loggin.jar
- commons-validator.jar
From the {STRUTS}/contrib/struts-el/lib directory:
- struts.jar
- struts-el.jar

3. Copied the struts-html-el.tld library file to WEB-INF.

4. Modified the index.jsp page to use the struts-html-el library file: <%@ taglib prefix="html" uri="/WEB-INF/struts-html-el.tld" %>

5. Named the success and fail jsp pages to output.jsp and failure.jsp respectively.

5. Put the SessionForm class in the WEB-INF/classes/com/struts directory and fixed a typo in the setName() method - changed "setName(String Name)" to "setName(String name)"

6. Put the ActionForward class in the WEB-INF/classes/com/struts directory and changed the "perform" method to an "execute" method.

7. Changed the struts-config.xml file:
- Changed definition to struts-config_1_1
- Added closing slash for form-bean tag that defines SessionForm
- changed action path from "/input" to "/logon"
- changed forward names from Output.jsp and Failure.jsp to output.jsp and failure.jsp respectively.
[ October 12, 2004: Message edited by: James Lopez ]
 
I once met a man from Nantucket. He had a tiny ad
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic