struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamholz, Keith (corp-staff) USX" <kkamh...@moog.com>
Subject RE: Cannot Find Bean In Scope Null?
Date Wed, 19 Jun 2002 14:35:15 GMT
This is extra confusing now, I've commented out the section the test to see
if the bean is empty and iterates it.  I still get the same error message.
I'm guessing the link to  /AddMC.do is the only spot where the bean might be
accessed.

Keith Kamholz
Moog 
East Aurora, NY
(716) 687-7282
kkamholz@moog.com


-----Original Message-----
From: Kamholz, Keith (corp-staff) USX [mailto:kkamholz@moog.com]
Sent: Wednesday, June 19, 2002 10:15 AM
To: Struts (E-mail)
Subject: Cannot Find Bean In Scope Null?


Hi everyone,
I've been having an issue for a while now with a couple of my ActionForm
beans.  I posted to the group before, and I've been working on several ways
to fix it, but nothing has worked.  My app is as follows (sorry, my
explanation is pretty long):
1) The user is taken to an intro page, where they enter a letter into a
form.
2) The letter is stored in HeaderBean (an ActionForm, in scope session) and
user is taken to an edit page corresponding to the value of the letter.
3) The edit page has a link, and when clicked the user is taken to another
page containing a form which edits the rest of the properties in the
HeaderBean.
4) Control is returned to the edit page.  The values of the HeaderBean
properties are displayed there.
(This is where things go haywire)
On that page there are 3 nearly identical sections.  One is:

<logic:equal value="Mass Change" name="HeaderBean" property="operation">
  Mass Change Detail Information:  <br>
  <html:link page="/AddMC.do">Add</html:link><br>
  <logic:notEmpty name="mcItems" property="line">
    <logic:iterate id="mcLine" name="mcItems" property="line">
      <bean:write name="mcLine"/><br>
    </logic:iterate>
  </logic:notEmpty>
  <logic:empty name="mcItems" property="line">
    NO ENTRIES
  </logic:empty>
</logic:equal>

What it does is tests the operation property of my HeaderBean, and then
displays the correct title with a link to fill info into one of my 3
problematic beans.  If there is info in the bean property, it is iterated
and displayed.  I'm not sure when a bean instance is created, but my only
guess was that it wasn't created until the user clicks on the link to add an
entry to the bean.  I tried to solve this with the <logic:empty> and
<logic:notEmpty> tags, but apparently those tags do not check the existence
of the bean.  (What do they do then?)
So now when my browser enters the body of the <logic:equal> I get an error
that says:
X Servlet Error: Cannot find bean mcItems in scope null:
javax.servlet.jsp.JspException: Cannot find bean mcItems in scope null

My actions and beans are clearly defined in my struts-config.xml, so I'm all
out of ideas.  My struts-config has this code:
<form-beans>
<form-bean 	name="HeaderBean" 
			type="com.moog.us.eos.beans.HeaderBean"/>
<form-bean 	name="mcItems" 
			type="com.moog.us.eos.beans.MassChangeItem"/>
(Plus my other form-beans)
</form-beans>
<action-mappings>
<action	path="/AddMC"
		type="com.moog.us.eos.actions.MassChangeAction"
		name="mcItems"
		scope="request"
		input="EditPage.jsp">
		<forward name="edit" path="EditPage.jsp"></forward>
		<forward name="addMC" path="AddMC.jsp"></forward>
</action>
(Plus my other actions)
</action-mappings>

I'm all out of ideas.  What can I do about this issue?  Any input would be a
big help.  Thanks!


Keith Kamholz
Moog 
East Aurora, NY
(716) 687-7282
kkamholz@moog.com


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message