I have exactly this set up with a J2EE servlet project using the WTP
Eclipse plug-in and a Flex Builder project in the wame Eclipse workspace.

It is best to start from the server project and create a Dynamic Web
Project first.  Get your servlet compiling and deploying into your app
server even if it is empty.  Create a Java package for your domain
model if you feel you need to start from having code.

Next create a Flex Builder project and use the server project you just
created as the context root.  I deploy my swf's into a folder at the
same level as WEB-INF which has the name of my app, therefore my URL
is of the form...

https://server:port/servletname/appname/projectname.html

e.g.

https://localhost:8443/pmco-spring-server/spm/spm.html in my case

pmco-spring-server is my WAR/EAR deployment name, spm is my app's
generic name and the name of the Flex project and spm is also the name
of my SWF root Application, so I have spm.html which embeds my spm.swf.

My folders look like this...

in the Java project...
C:\development\coral\eclipse\pmco-spring-server\src
C:\development\coral\eclipse\pmco-spring-server\src\pmco\pojos (my
domain model)
C:\development\coral\eclipse\pmco-spring-server\WebContent\spm this is
the output folder of my Flex project
C:\development\coral\eclipse\pmco-spring-server\WebContent\WEB-INF

on the flex side...

C:\development\coral\eclipse\spm this is my root app folder
C:\development\coral\eclipse\spm\pmco\pojos this is my domain model

"coral" is the release branch we are currently working on.

The steps to build and deploy (which we automate in production builds
using ANT) are to build the Flex project which has the output folder
set to the spm folder under WebContent in the Java project, and
therefore puts the swf's, html's etc into the deployment domain of the
Java app, and then to export the whole of the app from the Java side
as a WAR file.  That then gets copied into the deploy folder of the
servlet container, in our case JBoss, and the servlet is visible
through the web server.

You can actually start from flex or Java, it is just simpler to
configure the Flex project once you already have a server environment
set up and a server to talk to.

We have completely separate folders for each of the projects, Java and
Flex and the only link is that the code lived in the same SVN
repository and the Flex project builds into the Java project folder
for ease of deployment.

This has worked well for us and we are a multi-developer, multi-site
team.  We don't strictly partition responsibilities between server and
client code, but expertise tends to divide naturally along those lines.

I know it is a pain to get started and I hope this helps.  You'll
probably find a variant of this which will work for you and the
situation may be different for different app servers, but the J2EE
deployment model makes the structures similar in any case and don;t
worry, as long as you keep your code safe, restructuring when you
realise you have a better way of organising your activity is not the
end of the world.

Best of luck
Simon
--- In flexcoders@yahoogroups.com, "Leif Wells" <[EMAIL PROTECTED]> wrote:
>
> Matt,
> 
> At my workplace, we normally have a team working on the front-end and
> another working on the Java back-end.
> 
> Although we share the same Subversion repository, we place our code in
> separate folders. The front-end team uses the root of the "flex"
folder as
> the base of our Flex Builder project.
> 
> For compiling, assembling and deploying we use Ant. Seriously, Ant is
> awesome. Check out the Flex Ant Tasks found on Adobe Labs (
> http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks) for some
examples of
> the tasks.
> 
> To generally describe this to you, we have two build.xml files, one
in the
> Java folder and one in the Flex folder. The Java file will call to
the Flex
> build file, compile the Flex files and assemble them, then compile
the Java,
> move the Flex files into the Java deploy folder and then create the War
> file. When I come in to the office in the morning, I update my
Subversion
> repository, run the build process, start Tomcat and load up Flex
Builder.
> 
> I can't share the Ant files with you today, but they honestly are fairly
> easy to put together. That is one of the great things about Ant --- it's
> fairly easy to use.
> 
> I hope this helps you.
> 
> Leif
> 
> 
> On 9/18/07, mattmadhavan <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > mattmadhavan wrote:
> > >
> > > Hi,
> > > I would like the have the best practice to set up a webapp in my
> > Eclipse.
> > > What are the recommended directory structure for java/flex source
> > folders?
> > > Do I first create a webproject in eclipse, then place my flex binary
> > > folders in the webroot/WEB-INF folder? Do I keep my flex src
code under
> > > webroot or at the project folder?
> > >
> > > If some one can give me a step by step instruction on doing this
I would
> > > appreciate it. I need to work with both Java(server side-J2EE)
and flex
> > > client in the same project.
> > >
> > > Most flex app I see do not even have a webroot folder. They just
have
> > > WEB-INF folder in the root folder.
> > >
> > > Please, any ideas will be very appreciated.
> > >
> > > Thanks
> > > Matt
> > >
> >
> > --
> > View this message in context:
> >
http://www.nabble.com/Flex-Builder-Webapp-Flex-tf4476764.html#a12767245
> > Sent from the FlexCoders mailing list archive at Nabble.com.
> >
> >  
> >
>


Reply via email to