From: Matt Chotin
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 6:24
AM
To: '[email protected]'
Subject: RE: [flexcoders] Possible
to use Flex/Flash components Server-sid e?
Note that we don't
recommend having a JSP build up your data into a SWF unless it won't change
very often as the re-compilation per-user is very expensive.
Matt
-----Original Message-----
From: Dan Schaffer
[mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 1:20 PM
To: '[email protected]'
Subject: RE: [flexcoders] Possible
to use Flex/Flash components Server-sid e?
Tracy,
Another
idea is to do server side processing in a jsp page using the mxml tag
library. The jsp source can use the mxml tag library and generate mxml
code dynamically in java. Using this approach your java code can access your
back end resources do complex calculations/analysis and build the data directly
into mxml code. The tag library builds the generated mxml code into a swf
and returns it to the client. A jsp request has to return a full swf
instead of a component. It's an interesting idea to think about a jsp
returning a component instead of an mx:Application.
So the
client might request:
processReport.jsp?queryParam=param1&queryParam2=param2 (or pass
parameters as POST)
The jsp
may have code like:
processReport.jsp:
<%@
taglib uri="FlexTagLib" prefix="mm" %>
<mm:mxml>
<mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml>
<mx:Array id="dp0">
<%= buildTableData() %>
</mx:Array>
<mx:DataGrid dataProvider="{dp0}" />
</mx:Application>
</mm:mxml>
So your
buildTableData method is just a java method which processes the data on
the server in java then returns a string with the format of <mx:Object
param1="name1" param2="name2" /> for each datagrid
row. So client downloads the processed data and does not have do the work
on the client (and in actionscript).
Or
instead of generating object data as a dataprovider from java methods you could
generate normal mxml tags populated with the data.
Also
when building some applications I have written java http services which call
web services and process the data instead of making the client do additional
calculations.
Dan
-----Original Message-----
From: Tracy Spratt
[mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 3:04 PM
To: [email protected]
Subject: RE: [flexcoders] Possible
to use Flex/Flash components Server-sid e?
Thanks,
Since
duplicating my AS logic in another language is not practical, I will just have
to pull everything down to the client for my batch operations.
I'm not
completely giving up on this idea, though. Maybe a server-side piece
could impersonate a client and access the flex on a second server....
Thanks,
guys.
Tracy
From: Elliot
Winard [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 2:11 PM
To: '[email protected]'
Subject: RE: [flexcoders] Possible
to use Flex/Flash components Server-sid e?
Of course,
your components would then have to be implemented as Java rather than
ActionScript.
-e
-----Original Message-----
From: Matt Chotin
[mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 11:06
AM
To: '[email protected]'
Subject: RE: [flexcoders] Possible
to use Flex/Flash components Server-sid e?
No, Flex
components aren't meant to be run on the server. This sounds like you
might have a use-case for writing true server-side logic that you would then
call via RemoteObject (or WebServices).
Matt
-----Original Message-----
From: nts333rd
[mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 8:11 AM
To: [email protected]
Subject: [flexcoders] Possible to
use Flex/Flash components Server-side?
Say I
have very complex, faceless mxml components (that do data
service access, validation, caluclation, analysis,
etc) that usually
are accessed via a flex UI in the normal fashion.
But sometimes, I want to change the data
underneath several of them,
initiate the processing, and simply return single
values to some
master administration UI.
Is it possible to programatically instantiate an
initialize flex
components a the (some?) server, and return only
the single value?
Sort of making flex components work like a web
service or Java
servlet themselves? And accessing via remoting or
some such?
This would be for an intranet-type application, so
server load would
be manageable.
Any ideas? Directed rtfm?
TIA!
Tracy Spratt