Ah, ok, that's what I get for just skimming :) Your understanding is correct.

Speaking to serializing of client-side javascript objects, it is an interesting idea and I would be interested to see a proof of concept. The two alternatives I have used in the past for passing complicated data structures back to the client are:
1. Use XPath notation for HTML form element names, then use JXPath to reconstruct the Map, POJO, DOM, or whatever on the server side. 2. Use a client-side Javascript XML-RPC library to pass any Javascript data structure to an XML-RPC service on the web server. This has, among other advantages, the ability to perform complex tasks without reloading the page resulting in drastic performance improvements.


Don

Hubert Rabago wrote:

Don, Frank,

My understanding of the proposal is that its goal is to somehow
convert client-side javascript objects to server side java objects,
and my understanding of Struts flow is that it uses server side
scripting languages in place of precompiled java classes.  Am I
correct on both counts?  If so, are they still compatible?
Wouldn't the client side objects need to be serialized and submitted
to the server, where a server side object would attempt to map that
into a server side class?

Hubert


On Fri, 29 Oct 2004 13:45:34 -0700, Don Brown <[EMAIL PROTECTED]> wrote:


Actually, I just wrote a web application that uses Struts 1.2.4, Struts
Flow - http://struts.sf.net/flow , iBATIS database layer, and a touch of
Java.  Struts Flow allows you to use a Javascript function to replace a
Struts action.  I use iBATIS to run SQL queries and return Lists of Maps
(a Map keyed by column names in the result set), then feed those Maps to
the JSP.  Struts Flow provides a jsobjectToMap function that lets you
convert a Javascript object to a Map, and likewise, a ScriptableMap
which lets you access a Map as if it was a Javascript object.

This technique let me write an entire application mostly in Javascript
with very little code.  The iBATIS sql map layer functioned as my DAO
and the use of Maps as my data structure worked great.

If you have any questions, I'd be happy to elaborate.  The bottom line
is it is very possible and in fact quite easy to write a Struts app
using mostly Javascript, with a smattering of Java for things like
application init and more complicated algorithms.

Don



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to