Dec 9th, 2008, 11:40 AM
Spring MVC Flex integration
I'm looking for some advice from anyone with experience integrating Flex into an existing j2ee project.
We have a jboss/hibernate/spring-mvc project and so far we've been able to get away with ajax in providing most of our RIA functionality.
I'm looking for some advice in how to best go about integrating flex into an already mature j2ee project.
I have seen plenty of guides online that usually start with a brand new project and go from there, but almost none telling you how to best integrate it with an existing project.
So i would like some advice from anyone who has done this before and learned a few things in the process.
Any and all suggestions are welcomed. I realize that the question is very broad and generic but we're looking for advice in all fronts, from code structuring and ant build integration, to integration with spring mvc and authentication.
We're obviously looking for a 'minimally invasive' approach but any advice you can share is appreciated.
Dec 9th, 2008, 10:33 PM
We have used flex in our existing project,
We have used flex charting to generate good looking reports, ofcourse the backend is spring .
we have used granite data services that enables AMF communication between the swf file that gets generated and the server side java objects (spring objects).
granite is open source,
I dont know what you are actually looking for? whether to replace the html code in the ui with flex generated swf.
Dec 14th, 2008, 02:09 PM
Dec 17th, 2008, 11:24 AM
Sorry for the not replying sooner guys but i was away for a few days.
Sami thank you very much for the link to granite. I managed to integrate it in our existing project and tested exposing some of our EJBs through AMF. It works great.
Basically our front end right now is just JSPs.
But basically the rest of our front end is going to remain the way it is because it would be too much work to convert the whole thing to flex, and we don't really need/want to.
So I was just going to embed the compiled .SWFs in our jsps.
Right now i'm trying to figure what the best way to structure everything is.
Since only a few pages will have flex components, i wasn't sure if i should make every component its own flex app, or if i should just have one flex app that's basically just a loader and it loads the correct component based on the jsp it's on.
Or if there is a third better option to do this.
Also after looking at the mxmlc ant task it seems i need to always put the name of the swf output file in the build file. I'm trying to avoid having to modify the build file each time i add a new flex component to one of the JSPs.
Dec 17th, 2008, 01:13 PM
I suspect that having a single app that reconfigures itself based on which page it is being displayed in is just adding unnecessary complexity to your app. It isn't that much overhead on the developer side to have a different flex app for each page component and will simplify each app. If there is lots of code to share between them, you can provide a library that is loaded by multiple apps.
I can't help you with your ant task, I'm afraid, though if each flex component is a separate flex app, it makes sense to me to have to modify your build environment to accommodate a new project, so I'm not sure what the problem is. I can't see how you might add a new java library build target without providing a build target and a name for the resulting jar file, for example. There are likely some tricks you can play that will extract a name from a directory or properties file, if you really want to consider the build.xml file to be inviolable.
Dec 17th, 2008, 01:49 PM
Well modifying the build file is not that big of a deal really.
I was just trying to avoid it, and see if people have a better way of doing it. Just trying to make things as easy as possible for our designers...