Darcie Huntress wrote:
>
> On my starting page, I have instantiated a bean with scope="session" and
> called it "Person". On this initial page, I can call its method
> "getPropertyValue" and see valid data. When I create another page (which
> gets loaded after this initial page, so no race condition should be created)
> I am having problems being able to reference "Person". I have tried what
> seems like every possible combination of attributes... what am I doing
> wrong?
>
> Example -- Initial Page:
> ----------------------------------
> <%@page language="java" import="com.silknet.ebiz.silkmodels.BusinessObject"
> errorPage="errorpage.jsp"%>
> <jsp:useBean id="Contact" scope="session"
> class="com.silknet.ebiz.silkmodels.BusinessObject"/>
> <jsp:useBean id="Person" scope="session"
> class="com.silknet.ebiz.silkmodels.BusinessObject"/>
> <%
> String eKey = request.getParameter( "key" );
>
> Contact.setName( "Contact" );
> Contact.setKey( eKey );
> Contact.getData();
>
> Person = Contact.searchEntity("Parent");
> out.println( Person.getPropertyValue( "lastName" ) );
> %>
>
> Subsequent page:
> --------------------------
> <%@page language="java" import="com.silknet.ebiz.silkmodels.BusinessObject"
> errorPage="errorpage.jsp"%>
> <jsp:useBean id="Person" scope="session"
> class="com.silknet.ebiz.silkmodels.BusinessObject"/>
>
> <%
> out.println( Person.getPropertyValue( "firstName" ) )
> %>
>
> I get "null" back for the value, and the page is compiling with no errors.
> I am using JSWDK 1.0.1.... could I have a configuration problem, perchance?
What you do looks fine to me. Do you have cookies enabled in your browser?
JSWDK doesn't support URL rewriting for session tracking so you must use
cookies. Other than that, the only thing I can think of is that the two
JSP pages belong to different servlet contexts (session data does not cross
contexts) or that you invoke them with different hosts in the URL (e.g. use
the DNS name in one and the IP address in the other; cookies are by default
only sent back to the host they came from, based on the host specified in the
URL).
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html