View Full Version : Dynamic LZX authoring
Is it possible to have the LZX files be JSP files that are preprocessed by Tomcat?
This could be one possible solution to I18N.
antun
10-11-2004, 08:27 AM
You mean dynamically-generated LZX? Sure; that's how Laszlo-in-10-minutes works. I don't see how that will help with international character sets though.
-Antun
you could, for example, insert the localized text dynamically, from property files. This is achievable only through the use of server side dynamic technology like JSP.
Could you specify a bit about how can I do this?
Thanks.
Do you have access to a PHP enabled server .. preferably PHP 5.0.2 since PHP 5 offers simpleXML .. (but not vital if you only have access to php 4x)?
Perhaps on another Apache / PHP server?
If yes, you can create lzx scripts on the fly.
Although scripting can be done in jsp, my personal preference is to use php.
PHP is out of the question since my corporate uses JSP and I can't switch technologies just like that.
My question is how (technically) this works?
As I enderstand it, the LPS servlet (com.laszlosystems.servlets.LZServlet) receives the requests for .lzx files. It then converts the static lzx files to Flash files and sends those back to the browser. How can I make this servlet to forward the request to a JSP so that the JSP outcome is the lzx stream to convert to Flash?
here ?? ..
http://www.laszlosystems.com/lps/docs/lzx-developers-guide/lps-request-types.html
Preprocessed Requests
The LPS also supports using dynamic, server-side back-end processors (e.g., PHP, JSP) to generate LZX application source code before the LPS compiles and serves it. For URLs that end in .lzx for which the LPS can not find a matching source file on disk, the LPS will strip off the .lzx suffix and run attempt to get the content of the modified URL via an HTTP GET. The contents returned should be a properly formatted LZX file. The LPS will then compile and server an application based on the dynamically generated source code. For example see the hello.jsp file in the examples directory. This example generates a Laszlo application that contains information about the current time and session. You can see the generated LZX source at:
http://localhost:8080/lps-2.1.2/examples/hello.jsp.lzx?lzt=source
and the generated application at:
http://localhost:8080/lps-2.1.2/examples/hello.jsp.lzx
but note that the 2.1.2 links above on laszlo site are broken so hunt around for hello.jsp.lzx
dteare
10-12-2004, 06:51 PM
I got this to work and it seems pretty neat. It shouldn't be a problem to plug in any web application framework - be it struts, tapestry, etc.
One problem I have though is finding dependencies such as fonts, images, etc. It seems that if I put the assets in the same directory as the jsp, it works. If I try to reference assets in subdirectories, the LZX compiler can't find them.
I am using an existing page that works perfectly when called directly (i.e. when it is a lzx file). Once I wrapper it in a jsp, I can no longer find assets in subdirectories.
Any ideas? I'd hate to have a flat file hierarchy.
Thanks!
--Dave.
alvim
06-02-2005, 11:04 AM
Hi Dave...
Did you find any solutions for the "subdir" problem?
I'm trying the same thing.
Thanks in advance!
Paulo
Powerlogic - Brazil
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.