- This topic has 1 reply, 1 voice, and was last updated 14 years ago by davemeurer.
-
AuthorPosts
-
davemeurerMemberIf using Flash Builder as a dropin inside MyEclipse for Spring 8.6, here are a couple considerations and tips when setting up your projects. There are many ways to set up a MyEclipse Spring Flex project, and the following 3 are what I’m assuming will be the most common:
1. Create a Flex Project, then Spring Scaffold
2. Create a Web Project, then add the Flex Project type, then Spring Scaffold
3. Create a Web Project, then Spring Scaffold, then add the Flex Project typeEach of these has it’s own tweaks, and #3 seems to be the easiest… but I’ve spent the past couple of days on #1, so I wanted to publish these tips:
When creating a Flex Project, with BlazeDS and Java WTP support – here is how I’ve gotten the scaffolding to work:
1. Delete all libs in the WEB-INF/lib folder
2. In the Build Properties, remove the Tomcat Library and add the MyEclipse Java EE Library. Tomcat is added when you are configuring the server during the Flex Project creation.
3. Find the .flexProperties file (root of project), and set the serverContextRoot to the actual context root. It will reset to /WebContent everytime you hit the flex build properties page. Seems to be an Adobe bug: http://bugs.adobe.com/jira/browse/FB-20894
4. Scaffold what you want
5. In the WEB-INF/flex/services-config.xml, add the following to the services block (take out the remoting service-include)<default-channels> <channel ref="my-amf" /> </default-channels>
6. In the web.xml, point the /messagebroker/* servlet-mapping to Flex Servlet
Let me know if anyone out there has other use-case scenarios when creating projects, or any questions with setting up projects in Flash Builder.
davemeurerMemberThis post covers scenario #2 above, but with a twist: Create a MyEclipse for Spring Web Project, THEN scaffold, then add the Flex nature:
1. Create a MyEclipse for Spring Web Project and Scaffold a Flex CRUD app. [See tutorials if you have no idea what this means]
2. Right-click the project > Add/Change Project Type > Add Flex Project Type
3. In that wizard set the Application server type: J2EE, Use remote object access service > BlazeDS
4. Click Next:
— Root Folder: WebRoot of project
— Root URL: update URL with project name
— Context Root: project nameClick OK.
5. An error about Cannot create HTML wrapper will appear. Right-click the error to resolve the issue. If you don’t see the right-click context menu item, it can be resolved by right-clicking on the project > Flex Compiler > un-check “Generate HTML wrapper file”. Click OK. Then go back into the Project properties, Flex Compiler and check “Generate HTML wrapper file” to turn it on, and click Ok.
6. There will also be an error on the index.template.html file. You can read more about what that file does by following the link, but essentially it’s not essential to compiling the flash file or running the application. So, you can turn off the javascript “build” validation for javascript if you want to remove that error. Window > Preferences > Validation > uncheck javascript Build validation
7. Right-click project >Properties > Flex Build Path > Main source folder: change to flex_src. Click OK to apply.
8. Back in project properties > Flex Applications.
— Remove [project].mxml
— Add… Manage*.mxml, set one of them as default.
— Click OK.9. Notice the Manage*.html and Manage*.swf files are now being generated in the output folder specified in the project Properties > Flex Server > Output folder. The default is WebRoot\[projectname]-debug,
10. You can now run the application, and browse to: http://localhost:8080/%5Bprojectname%5D/%5Bprojectname%5D-debug/Manage%5Bdomainobjectname%5D.swf
Enjoy!
Dave -
AuthorPosts