For accessing the user's session or httpRequest you can use:

FlexContext.getHttpRequest();
FlexContext.getFlexSession();

You can then call setAttribute()/getAttribute() on the session, to get
and store things like userId, loggedIn status, etc

To listen for sessions starting and ending, use:

FlexSessionListener

These are explained somewhat here:
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=messaging_framework_6.html

Something to watch out for big time, is that if your setup is
clustered where each request might go to a different server,
then the above setup will not work as expected. You would need to
enable session replication across servers, which is
a whole nuther topic ;)


As far as frameworks for Flex remoting apps, I like to keep things as
simple as possible..

Apache/Tomcat + BlazeDS + Hibernate/Mysql + Java/POJO's = pure goodness..
of course JBoss works even better and is more scalable..



- Alan

On Fri, Mar 21, 2008 at 2:56 PM, Derrick Anderson
<[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> hi jim, thanks for your response-
>
> for the first question, i want to save variables on the server because in my 
> application, the database used for all queries is determined at login 
> (different clients go to different databases) but it's all the same client 
> code.  when the backend was coldfusion I would just save that datasource name 
> in a session variable and use it for my queries.  if i cannot save to the 
> server, i have to pass that variable to all remoteObject requests so it knows 
> what DB to interact with.  that page you sent me looks most helpful for this
>
> for the framework i was more asking on the java development side of things.  
> i hear people talk about Spring and others, just wondering if I should be 
> using something like that or just writing pojo's.  (i know nothing about java 
> frameworks)
>
> thanks again,
> d.
>
>
>
>
>
>
>
>
>
> On Fri, Mar 21, 2008 at 12:59 PM, Jim Boone <[EMAIL PROTECTED]> wrote:
>
> >
> >
> >
> >
> >
> >
> > Derrick,
> >
> > Your correct, this isn't a simple questions.
> >
> > 1) Why do you want to save variables in session on the server when you
> > can save state in your client? If you really have a business need to
> > save session variables, then look in the section titled "Working with
> > session data" in the BlazeDS Developer Guide.
> > (http://livedocs.adobe.com/blazeds/1/blazeds_devguide/) There is a
> > great example of how to write a remote Java object that will give you
> > access to anything in the request/response streams.
> >
> > 2) Working with query result sets? Simple, just create some type of
> > collection with the result set objects. Define an equivalent object on
> > the AS3 side (make sure you include the RemoteObject meta tag on the AS3
> > object), and let BlazeDS convert the dataobjects to and from AS3 to Java
> >
> > 3) Frameworks are a function of how big the project is and how many
> > folks might be working on it. If it is simple, you don't need a
> > framework. More complex projects can but don't need to. You can use
> > Cairngorm or PureMVC. I have used both and prefer PureMVC for the
> > reasons that the author states on his web site.
> >
> > I know this is only a start but your Qs cover a bunch of ground.
> > Remoting between Flex and Java is almost brain-dead simple primarily
> > because BlazeDS is written in Java and Adobe has abstracted away all the
> > complexity. Good luck!
> >
> > Jim
> >
> > --- In [email protected], "Derrick Anderson"
> >
> >
> >
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > hey everyone, i'm switching my server side app from coldfusion to
> > java- i'm
> > > still new to java so i'm looking for some docs or any tips that cover
> > the
> > > basics:
> > >
> > > 1) sessions/persisting variables between requests to the app server,
> > how do
> > > you handle it? i'm assuming that I might need an application server
> > to
> > > handle that right? My current plan was to just export my java project
> > to a
> > > JAR- what options do I have for persistence?
> > > 2) working with query resultsets
> > > 3) any particular framework that you develop in that works well with
> > blazeds
> > > (or does it matter)?
> > >
> > >
> > > sorry, i know it's really a java question, but I figure a lot of you
> > have a
> > > java background and might be able to give me some tips on ramping up
> > with
> > > java+flex (i have seen the blazeds turnkey sample apps, so i've seen
> > 1
> > > example of using List to handle query resultsets)
> > >
> > > thanks
> > > d.
> > >
> >
> >
>
> 



-- 
Alan Queen
President and Founder
DigiMix Inc.
http://www.digimix.com
404-964-7618

Reply via email to