yairiny
03-26-2006, 05:58 AM
Hi,
I have seen this discussed before in the forums (using search of course), but have not found a definitive answer to this.
The documentation states that in order for the requests from the Laszlo application to maintain session, we cannot use SOLO. Well, I have a simple SOLO app which seems to maintain the sesion well, I have even tried running it twice from two browser instances and it seems to work just fine. I am looking for a definitive answer to this from people in the know
Here is my code:
lzx file:
<!DOCTYPE canvas SYSTEM "lzx.dtd">
<canvas height="100%" width="100%">
<include href="lz/tree.lzx"/>
<dataset name="aternity" type="http" src="data1.jsp" request="true"/>
<view layout="axis: y; spacing: 10">
<tree datapath="aternity:/aternity/" showroot="false">
<tree datapath="location" text='${this.datapath.xpathQuery("@name")}'>
<tree datapath="office" text='${this.datapath.xpathQuery("@name")}'>
<tree datapath="department" text='${this.datapath.xpathQuery("@name")}' isleaf="true"/>
</tree>
</tree>
</tree>
<button text="UpdateView" onclick="updateView()" >
<method name="updateView">
<![CDATA[
canvas.aternity.doRequest();
]]>
</method>
</button>
</view>
</canvas>
jsp file:
<%@ page import="java.util.Random"%>
<%@ page contentType="application/xml;charset=UTF-8" language="java" %>
<%
Thread.sleep(3000);
Random rand = new Random(System.currentTimeMillis());
boolean val = rand.nextBoolean();
if ( val ) {
System.out.println("true");
}
else {
System.out.println("false");
}
//get the session object
System.out.println("session = " + session);
%>
<aternity>
<% if ( val ) {%>
<location name="Israel">
<office name="Hod Hasharon">
<department name="Administration"/>
<department name="R&D"/>
</office>
</location>
<%}else {%>
<location name="USA">
<office name="Boston">
<department name="Administration"/>
<department name="Marketing"/>
<department name="Sales"/>
</office>
</location>
<%}%>
</aternity>
Thanks,
Yair Iny
I have seen this discussed before in the forums (using search of course), but have not found a definitive answer to this.
The documentation states that in order for the requests from the Laszlo application to maintain session, we cannot use SOLO. Well, I have a simple SOLO app which seems to maintain the sesion well, I have even tried running it twice from two browser instances and it seems to work just fine. I am looking for a definitive answer to this from people in the know
Here is my code:
lzx file:
<!DOCTYPE canvas SYSTEM "lzx.dtd">
<canvas height="100%" width="100%">
<include href="lz/tree.lzx"/>
<dataset name="aternity" type="http" src="data1.jsp" request="true"/>
<view layout="axis: y; spacing: 10">
<tree datapath="aternity:/aternity/" showroot="false">
<tree datapath="location" text='${this.datapath.xpathQuery("@name")}'>
<tree datapath="office" text='${this.datapath.xpathQuery("@name")}'>
<tree datapath="department" text='${this.datapath.xpathQuery("@name")}' isleaf="true"/>
</tree>
</tree>
</tree>
<button text="UpdateView" onclick="updateView()" >
<method name="updateView">
<![CDATA[
canvas.aternity.doRequest();
]]>
</method>
</button>
</view>
</canvas>
jsp file:
<%@ page import="java.util.Random"%>
<%@ page contentType="application/xml;charset=UTF-8" language="java" %>
<%
Thread.sleep(3000);
Random rand = new Random(System.currentTimeMillis());
boolean val = rand.nextBoolean();
if ( val ) {
System.out.println("true");
}
else {
System.out.println("false");
}
//get the session object
System.out.println("session = " + session);
%>
<aternity>
<% if ( val ) {%>
<location name="Israel">
<office name="Hod Hasharon">
<department name="Administration"/>
<department name="R&D"/>
</office>
</location>
<%}else {%>
<location name="USA">
<office name="Boston">
<department name="Administration"/>
<department name="Marketing"/>
<department name="Sales"/>
</office>
</location>
<%}%>
</aternity>
Thanks,
Yair Iny