I tried that I doesn't seem as though the value of scope has any affect
on whether the body of the <jsp:useBean/> is evaluated.  On the other
hand, if the type attribute is used versus the class attribute, the
evaluation of body differs.  Using type, the body is skipped, using
class, the body is skipped if the bean exists.  I cannot get the body to
be evaluated if the bean already exists.

PublishedMessage message = (PublishedMessage)
pageContext.getAttribute("message", PageContext.REQUEST_SCOPE);
if(message == null) {
 if(JRunJSPStaticHelpers.getAndSetBean(pageContext, "message",
PublishedMessage.class, PageContext.REQUEST_SCOPE, 48)) {
  message = (PublishedMessage) pageContext.getAttribute("message",
PageContext.REQUEST_SCOPE);
  out.print("\r\n\t\t\t");
 
JRunJSPStaticHelpers.setBeanProperty(pageContext.getAttribute("message")
, "message", "contentTypeId", "", request, 49);
....
 }
}

Notice that if the request scope attribute exists, the body is not
evaluated.  In the case of using the type attribute, the if statement
doesn't even get created during the creation of the JSP->Servlet.

thanks,

brian

-----Original Message-----
From: Jim Gillaspy [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 7:48 AM
To: JRun-Talk
Subject: RE: <jsp:useBean>


By setting the scope to "page" you are forcing the instantiation of a
new
bean.  Set scope to "request" in both jsp pages if you want to use the
previously instantiated bean.

Jim Gillaspy

-----Original Message-----
From:   Brian Zimmer [SMTP:[EMAIL PROTECTED]]
Sent:   Thursday, January 11, 2001 7:33 PM
To:     JRun-Talk
Subject:        <jsp:useBean>

If I try to use the following syntax:

<jsp:useBean id="message" type="PublishedMessage" scope="page">
        <jsp:setProperty name="message" ...>
</jsp:useBean>

it seems as though JRun just ignores everything in the body.  I looked
at the generated source code and that is indeed the case.  How can I use
this tag with an already instantiated bean?  If I switch it to class, it
checks to see if a bean by that id is null, if so then it creates and
sets properties.  If it is not null, then it just skips the setting
altogether.

thanks,

brian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to