6dollarmillions.in

Adding Flex nature to MyEclipse web project

Following are the steps for creating a fully functional flex project with MyEclipse for Spring 8.6.1 (make sure you have 8.6.1. if you dont have it go to the software center and click on the software tab, check for the update version 8.6.1 and click update, once done it will ask for restart, so go and restart my eclipse for spring)

Here are the steps to follow:

1. Create a new web project and scaffold a spring crud flex application.

you have to do this for that right click on the project go to MyEclipse > Scaffold spring CRUD application...

a. select the database schema check box and click next
b. select MyEclipseDerby (default) and click next
c. in the catalog drop down select classiccars and select required tables (ex: customer,payment and click add you should see those tables in the scaffolding list)
d. select Customer as the parent and click next
e. give your own package (ex: com.suresh.test) it will update in all fields and click next.
f. now select the flex check box (if you have problem in clicking next after selecting flex check box, maximize the scaffol spring crud application window, now you should be able to see it) click next
g. select the flex sdk home if you have one or use the default one (i am using flex 4.5.0.17077) and slect the Flex 4.0 radio button and click next
h. in the next screen keep default and click next
i. in the next screen keep default and click next
j. in the next screen keep default and click next
k. final screen is the summary screen click finish.

it will take some time to scaffold the crud application be patient.
ok now the scaffolding is done.

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 name

ex:
-- Root folder: C:\Documents and Settings\suresh.paleti\Workspaces\MyEclipse for Spring 8.6\TestFlexSpring\WebRoot
-- Root url: http://localhost:8080/TestFlexSpring
-- Context Root: TestFlexSpring

then click validate configuration and click next

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. clean the project.

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. Now right click on the project Runas > Myeclipse server application thats it you can see the working application
or
You can start the server, and browse to: http://localhost:8080/[projectname]/[projectname]-debug/Manage[domainobjectname].swf

No comments:

Post a Comment