Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning JavaServer Pages
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaServer Pages
This is the forum to discuss the Wrox book Beginning JavaServer Pages by Vivek Chopra, Jon Eaves, Rupert Jones, Sing Li, John T. Bell; ISBN: 9780764574856
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaServer Pages section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 23rd, 2006, 08:16 AM
Registered User
 
Join Date: Feb 2006
Location: , Ohio, .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 19 error of: Cannot find bean: "org.apache

In case anyone runs into this error, I've pulled the following from the internet:

---- begin from internet -----

Seemingly, even experienced struts users encounter this kind of issue. There are a few reasons this happens

1.When there is a form object, which has no bean specified, name attribute is empty. e.g
<html:text property="name" />. Check if the property name is specified in the form-bean declaration if DynaActionForm or if the ActionForm has that property.

2. Secondly, check whether the <html:form is already there or not and does the form object in the <html:form></html:form>

3. Make sure the <html:form action="" /> points to the correct place where the form-bean definition is the same as when you are displaying the form.
It basically means check your action mappings also especially the name attribute

Sometimes, things are cached, restart your j2ee container would be the best bet to resolve suspects of cache issues

------ end from internet -----

Now I didn't get this problem with the exercises in the book as I did my own test. I struggled for at least two days with trying to get the strusts-config.xml file correct. At some point I had it correct but the app wasn't working just the same. I'd rebooted the PC at some point, but I can only conclude that I hadn't gotten the struts-config.xml file correct at that point.

Just the same, last night I finally turned the PC off and walked away from the problem; I'd had enough. This morning I turned the PC on and gave it one more try and it worked. What I can't tell you is what was causing the problem, except that something apparently is being cached.

I had a simple index.jsp that came up and did the following:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:link page="/main.jsp">Test the Main Form</html:link>

The main.jsp basically did the following (pertinent lines of code only shown here):

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:form action="/Main.do" method="post">
            Enter Request ID: <html:text property="requestID" size="10" maxlength="10"/><br>
            Enter Donation ID: <html:text property="donationID" size="10" maxlength="10"/><br>
            <html:submit/>
</html:form>

The results.jsp contained the following code:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head>
    <title>Needs Fulfillment - Testing Results Page</title>
    <link rel="stylesheet" type="text/css" href="needs.css">
</head>
<body class="body">
<h1 class="h1">Testing Results</h1>

<br>
Request ID: <bean:write name="ClosedDonationsForm" property="requestID"/>
Donation iD: <bean:write name="ClosedDonationsForm" property="donationID"/>
</body>
</html:html>

Struts-config.xml contained the folllowing:

<struts-config>

    <form-beans>

        <form-bean name="ClosedDonationsForm"
                    type="ClosedDonationsForm"/>
    </form-beans>

    <action-mappings>
         <action path="/Main"
                type="ClosedDonationsAction"
                name="ClosedDonationsForm"
                input="/main.jsp"
                scope="request">
            <forward name="success" path="/results.jsp"/>
    </action>
</action-mappings>
</struts-config>

The entire purpose of this was an attempt to learn one piece of struts - nothing more than that.

The action class simply did a mapping.findForward("success"). That's all.

The action form (java bean) did nothing but supply the getters and setters for the two fields.

I was trying to learn and test the forwarding action set up in struts-config.xml and cause the data transfer between forms using the java bean.

Point is: if you run into the same error, check things over and if all else fails, reboot the PC and give it another try. I'd carefully review everything first. If you've got something wrong, the rebooting isn't going to work and you'll end up considering that a failed attempt. Make certain all is right as best you can and then try the reboot.

Hopfully this may be of some help to someone.
Reply With Quote
  #2 (permalink)  
Old April 23rd, 2006, 08:17 AM
Registered User
 
Join Date: Feb 2006
Location: , Ohio, .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope

The thread title didn't take the full error message, so here it is in full.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19 xml error flashmanTom Visual Basic 2005 Basics 0 February 9th, 2008 02:05 PM
org.apache.jasper.JasperException:The value for th Lijin Apache Tomcat 1 January 18th, 2007 08:05 PM
Exception creating bean of class org.apache.struts chandseetare Apache Tomcat 0 May 14th, 2005 07:22 AM
org.apache.struts.* bongo76 Apache Tomcat 1 April 18th, 2004 05:06 AM
org.apache.strut.util.GenericDataSource elbicho JSP Basics 1 August 23rd, 2003 03:55 AM



All times are GMT -4. The time now is 03:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.