-- If you want to specify a new bean instance, use this:
<bean:define id="threadBean" type="org.MyOrg.MyProj.message.ThreadBean" />
<bean:write name="threadBean" property="sender"/>
<bean:write name="threadBean" property="threadReplyCount"/>
<bean:write name="threadBean" property="threadViewCount"/>

-- If the bean already exists
<bean:define id="threadBean" name"ThreadBean"
type="org.MyOrg.MyProj.message.ThreadBean"/>
<bean:write name="threadBean" property="sender"/>
...

I think this is right ..
Chris

-----Original Message-----
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 12, 2004 7:28 PM
To: [EMAIL PROTECTED]
Subject: Cannot Find Bean in Any Scope


I am using the Struts framework.  I have a JSP, which
imports a JavaBean "ThreadBean".  Therefore, in the
beginning of my JSP, in addition to 

<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/tiles" prefix="tiles" %>
<%@ taglib uri="/tags/request" prefix="req" %>

I have

<%@ page import="org.MyOrg.MyProj.message.ThreadBean"
%>

In my JSP, I try to write out the properties of this
JavaBean; for example:

  <%=threadBean.getSender()%>
  <%=threadBean.getThreadReplyCount()%>
  <%=threadBean.getThreadViewCount()%>

I got the error message:

----- Root Cause -----
javax.servlet.ServletException: Cannot find bean
threadBean in any scope

What is the correct way to do it?



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


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

Reply via email to