Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Best practice

  1. #1
    Join Date
    Oct 2009
    Posts
    20

    Default Best practice

    Thanks for integrating Flex + Spring.

    I succeed to run the testDrive sample on eclipse + tomcat.

    My question is:
    1. Is it possible to run the testDrive sample on Flex Developer? - In Flex Developer IDE there are no option to configure a server (e.g tomcat).
    2. What is the best practice of deveolping flex + spring? To design in Flex Developer and then code and defined the Spring part in eclipse. There must be a faster way of development!

    Thanks

  2. #2
    Join Date
    Oct 2009
    Posts
    20

    Default Eclipse with Flex builder plugin

    I succeed to install the Flex Builder plugins
    But the design panel of Flex shows an error:
    "An unknown item is declared as the root of your MXML document. Switch to source mode to correct it."
    So I can not see the components in the MXML design panel

    How to fix it?
    Last edited by isys; Oct 28th, 2009 at 12:04 PM.

  3. #3
    Join Date
    Oct 2009
    Posts
    20

    Default create new Fx project works fine with plugin

    create new Fx project works fine with plugin
    but the testDrive sample has problems with the MXML editor
    All the projects imported from the testDrive sample are not recognized as Fx project, therefor the IDE (eclipse 3.4.2 with flex 3 plugin) can not display the components in the MXML file.

    Some one must have solved this!
    Please help

  4. #4
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    I'm not entirely sure the menu options are exactly the same in FB3, but in the new Flash Builder 4 Beta 2 plugin, you just right-click on the project and select "Add/Change Project Type -> Add Flex Project Type..." and follow the dialogs from there.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  5. #5
    Join Date
    Oct 2009
    Posts
    20

    Default Is it possible at all to display the testDrive sample in design mode?

    Quote Originally Posted by jeremyg484 View Post
    I'm not entirely sure the menu options are exactly the same in FB3, but in the new Flash Builder 4 Beta 2 plugin, you just right-click on the project and select "Add/Change Project Type -> Add Flex Project Type..." and follow the dialogs from there.
    1. I recreated my IDE, install eclipse 3.4.2 with FB4 beta 2 plugin.
    2. Imported the testDrive sample
    3. Run on Tomcat 6

    So fare it works.

    But when I try to open a MXML file in the design editor panel nothing is displayed. (in FB3 an error was shown: "An unknown item is declared as the root of your MXML document. Switch to source mode to correct it."
    )
    .
    Then I tried to follow your instructions to change the project type, which just erase the original structure of the project.
    Sorry it didn`t help.

    Is it possible at all to display the testDrive sample in design mode?

  6. #6
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    The trick is that you've got to set everything up to mimic the Maven build. Here are the steps I just went through for the "insync01" project as a test. This assumes you've already got all of the projects imported into Eclipse.

    1. Right-click on the project, select "Add/Change Project Type...->Add Flex Project Type..."

    2. Set the Flex SDK Version to Flex 3.4, the Application server type to "J2EE" and "BlazeDS", then click "Next >"

    3. Here is the annoying part...it seems it won't allow you to specify relative paths for the server. So for "Root folder:" click "Browse..." and manually navigate to the equivalent of "../testdrive/src/main/webapp". Set "Root URL:" to "http://localhost:8080/testdrive/". Set "Context root:" to "testdrive". Click "Validate Configuration". It will probably show a warning saying "Server root is not pointing to a BlazeDS server root folder." but this is okay, things still seem to work. For "Output folder:" click "Browse..." and manually choose the equivalent of "../testdrive/src/main/webapp/insync01". It will show a warning that the folder already exists, but this is okay. Click "Finish"

    4. It will create a blank "insync01.mxml" in the project root...leave it for now. Right-click on the project and select "Properties". Select "Flex Build Path". Switch to the "Source path" tab. For "Main source folder:" click "Browse..." and select the "src/main/flex" folder. Click "OK". You can now delete the empty insync01.mxml, and you should be able to open up the correct one in Design view. If you've got the Tomcat server running, you should also be able to Right-click the project and select "Run As...->Web Application".

    (One last thing I ran into...this may have just been my Eclipse install...I get an error about not being able to generate the HTML wrapper. I was able to right-click on the specific error in the "Problems" view and select "Recreate HTML Templates" and it worked.)

    Also, to answer your original question, my setup is to use SpringSource Tool Suite as the base Eclipse install, and then install Flash Builder as a plugin on top of it. This gives you the best of both worlds in one single environment. I should also note that I'm using the Eclipse 3.5 version of STS, as I had some weird issues with not being able to run Tomcat in Debug mode when installing the plugin on the 3.4 version.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  7. #7
    Join Date
    Oct 2009
    Posts
    20

    Smile Can display in design mode but after editing on mxml then the html disappear

    Quote Originally Posted by jeremyg484 View Post
    (One last thing I ran into...this may have just been my Eclipse install...I get an error about not being able to generate the HTML wrapper. I was able to right-click on the specific error in the "Problems" view and select "Recreate HTML Templates" and it worked.)
    Thaks alot. But still one problem left.

    I use STS with FB4 plugin and followed your instructions.
    1. The insyn01.mxml is displayed in design mode.
    2. Run the testDrive on Tomcat. Great
    3. I edit insyn01.mxml by rename the search button in design mode.
    4. Then Run the testDrive on Tomcat. The browser failed: HTTP Status 404 - /testdrive/insync01/insync01.html

    After investigating I found out that a html file should be created in the path "testdrive\src\main\webapp\insync01".
    I think that some definition is missing. No insync01.html file was created.
    How to define in the insync01 flex project to create the html file and locate in /testdrive/insync01/insync01.html ?
    Last edited by isys; Nov 1st, 2009 at 09:51 AM.

  8. #8
    Join Date
    Oct 2009
    Posts
    20

    Default Succeeded - able to edit in design mode and run it

    Quote Originally Posted by jeremyg484 View Post
    (One last thing I ran into...this may have just been my Eclipse install...I get an error about not being able to generate the HTML wrapper. I was able to right-click on the specific error in the "Problems" view and select "Recreate HTML Templates" and it worked.)
    Before the problem you mention "Recrate HTML Template", there was one more problem with locale iw_IL. I changed it to be en_US, but the problem of HTML wrapper was not in the list of problems. Somehow, now it is listed and I selected "Recreate HTML Templates" and it works.

    Great!! Thanks

  9. #9

    Default

    Quote Originally Posted by jeremyg484 View Post
    Also, to answer your original question, my setup is to use SpringSource Tool Suite as the base Eclipse install, and then install Flash Builder as a plugin on top of it. This gives you the best of both worlds in one single environment. I should also note that I'm using the Eclipse 3.5 version of STS, as I had some weird issues with not being able to run Tomcat in Debug mode when installing the plugin on the 3.4 version.
    Thank you for these detailed and informative instructions! Worked great for me.

    How do I configure my Springsource Tool Suite w/ Flash Builder setup to step debug through the Flex code? For example, I want to step debug through the send() function in the JMS Chat example (jmschat.mxml).

    I tried to apply your instructions for the "insync01" project to the "insync02" project and set a breakpoint at line 16 of insync02.mxml. Unfortunately, execution does not stop there. I don't know if its because there is a red "f" symbol on top of the insync02 project - which appeared after I followed your above instructions to try to debug it.

    Any help would be greatly appreciated.

  10. #10
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    Make sure you're using the debug version of the Flash player. The installer for it comes with the Flex SDK download. There is a helpful page here that will detect and display your installed version of the player: http://kb2.adobe.com/cps/192/tn_19245.html
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •