Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communications between OpenLaszlo application & server side resource

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
How an OpenLaszlo application communicate with back end code (EJBs, Servlets, Web services..)?
Does it employ HTTP or it has its own mediator/interceptor?
And for the server side resource, have they to be Java code? or any code (Python for example) could be called?
Thanks.
 
Norman Klein
author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laszlo only requires XML over HTTP, so it is completely compliant with the existing HTTP standards. The server only needs to change its content type to "text/xml" and output a valid XML document.

This is a capability supported by all web servers. Its even pretty easy to update most existing server side applications to support Laszlo, since only their JSP files need to be updated. So you'll have one set of JSP files for HTML and another for XML.
 
Norman Klein
author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laszlo only requires XML over HTTP, so it is completely compliant with the existing HTTP standards. The server only needs to change its content type to "text/xml" and output a valid XML document.

This is a capability supported by all web servers. Its even pretty easy to update most existing server side applications to support Laszlo, since only their JSP files need to be updated. So you'll have one set of JSP files to output HTML and another for XML.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there plans to support different types of content? JSON, Some form of a remoting API? Anything other than XML?
 
Norman Klein
author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since OpenLaszlo is open source software, it supports most standard compliant software either directly or through contributed libraries. So for instance, it supports JSON through the json.js library.

You can read more about Laszlo JSON support at http://www.theserverside.com/tt/articles/article.tss?l=LaszloWithoutXML

Laszlo also supports RPC. Further information is available in the Laszlo docs at http://www.openlaszlo.org/lps/docs/guide/rpc-javarpc.html
 
al greezlee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks interesting - also a section in the guide on server 'push' using the Connection class .. will these methods work in DHTML output?
 
Norman Klein
author
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Laszlo architecture is designed to allow it to be easily ported to new web platforms. Each runtime consists of a kernel, which provides a clean abstraction between OpenLaszlo and runtime-specific details. Each kernel is a collection of classes in two major categories: sprite classes, and environment classes. Sprite classes handle the visual display of OpenLaszlo views, text and input text boxes. Environment classes provide supporting APIs for handling mouse and keyboard events, getting timing information, and loading data or code at runtime.

So when Laszlo was ported to the DHTML platform, it only required the creation of DHTML sprite classes, instead of a complete rewrite for that platform. This allows core Laszlo functionality to be available to each platform.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic