PDA

View Full Version : problems displaying inside jsp


SueP
11-10-2004, 11:41 AM
I wrote a very simple .lzx file with a "hello world" button and a simple tree. When I access the page directly it works fine. I then tried to include the file inside of a jsp application and now it only displays the button, the tree doesn't appear at all.

Could this be because it can't find the <include href="lz/tree.lzx"/> in my laszlo file? But, it also has trouble recognizing other laszlo tags.

Here are all the different ways I tried to include my .lzx file into my .jsp page:


Attempt #1
<script src="/includes/embed.js"></script>
<script>

lzEmbed({url: 'test.lzx?lzt=swf', bgcolor: '#eaeaea', width: '640', height: '540'}, true);
</script>


Attempt #2
<div>
<script type="text/javascript" language="JavaScript" src="http://localhost:8840/lps-2.2/test.lzx?lzt=embed">
</script>
</div>

Attempt #3
<div>
<%@include file="/test.lzx" %>
</div>


Attempt #4
<div>
<jsp:include page="test.lzx" flush="true"/>
</div>

My ultimate goal is to try to get a laszlo tree component to communicate w/ my jsp app so that selecting an item in the tree will cause it to be displayed in my application. I'll probably have more questions about this later. For now I'm just frustrated trying to get it to display "Hello World"!.

Any help would be much appreciated!!
Thanks, Sue

antun
11-10-2004, 12:03 PM
Attempt #1 should work, but you might have to check the paths to the .js file. Probably needs to have the LPS in there.

-Antun

SueP
11-10-2004, 12:42 PM
That was definitely a problem - I fixed the path to the embed.js file.

Now it prints the following on the screen rather than displaying the laszlo app:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" width="640" height="540" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"><param name="movie" value="/lps-2.2/test.lzx?lzt=swf" /> <param name="scale" value="exactfit" /> <param name="salign" value="lt" /> <param name="width" value="640" /> <param name="height" value="540" /> <param name="bgcolor" value="#eaeaea" /> <embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="exactfit" src="/lps-2.2/test.lzx?lzt=swf" quality="high" salign="lt" width="640" height="540" bgcolor="#eaeaea"/></object>

antun
11-10-2004, 12:47 PM
That's strange. That's what the LzEmbed() JavaScript function should write out to the browser. You could copy & paste that into your .jsp page instead of the LzEmbed <script> block.

-Antun

SueP
11-10-2004, 01:00 PM
I tried that and it now includes my laszlo app but I'm now back to my original problem where the button displays but the tree doesn't show up. I tried changing the tree include path <include href="lz/tree.lzx"/> in my .lzx file but then it says file not found.

(Note: when I view the laszlo app outside the .jsp page, the tree works fine.)

Thanks so much for your quick replies!

SueP
11-10-2004, 01:15 PM
nevermind! I have my tree displaying now - not sure what I changed to get it to work.

Thanks.