UML to JEE : First applications with JEE module

From AcceleoWiki

Jump to: navigation, search

Tutorial : Our first applications

Our first struts application

  • 1 - Create a new Dynamic Web Project.
    Image:UML_to_JEE_-_First_Struts_Application_-_1_-_New_dynamic_web_project.png‎
    • 1.1 - You can customize it as you want.
      Image:UML_to_JEE_-_First_Struts_Application_-_2_-_Configure_project.png
    • 1.2 - Once finished, you should obtain a project like this
      Image:UML_to_JEE_-_First_Struts_Application_-_3_-_Project_wizard_result.png



  • 3 - Create a new UML model


  • 4 - Use the module launcher
    • 4.1 - Call Acceleo Module launcher via File > New > Module launcher
      Image:UML_to_JEE_-_First_Struts_Application_-_10_-_Module_launcher.png
    • 4.2 - The module to use is JEE Struts generator
      Image:UML_to_JEE_-_First_Struts_Application_-_11_-_Struts_module_call.png
    • 4.3 - Give a name to the module (It should be explicit ! You can use many chain in the same project)
      Image:UML_to_JEE_-_First_Struts_Application_-_12_-_Naming_the_chain.png
    • 4.4 - Select the model you just create.
      Image:UML_to_JEE_-_First_Struts_Application_-_13_-_Select_the_model.png
    • 4.5 - Finish the wizard. A new chain is created. Now you just have to call it !
      Image:UML_to_JEE_-_First_Struts_Application_-_14_-_Launch_chain.png‎


  • 5 - Exploit the generation result
    • 5.1 - The module generates a struts architecture "ready to use".
      Image:UML_to_JEE_-_First_Struts_Application_-_15_-_Generation_result.png
    • 5.2 - However, there is a compilation error in the generated sources. To solve it, we have to add a reference to the JUnit library (for the HTMLUnit). Use theRight click on the project > Build path > Add libraries .. menu.
      Image:UML_to_JEE_-_First_Struts_Application_-_16_-_Add_lib.png
    • 5.3 - Select JUnit and finish.
      Image:UML_to_JEE_-_First_Struts_Application_-_17_-_Junit_lib.png
    • 5.4 - A little step rest to obtain a functional application : Since we can't generate the perfect JSP as everybody wishes, we use a "One Shot generation" way to create this JSP. We generate sample of JSP in a "generated" folder. You have to copy it in the "WebContentDirectory".
      Image:UML_to_JEE_-_First_Struts_Application_-_17_bis_-_JSP_copy.png
    • 5.5 - Now the project compiles. We can launch it on a server. For that, use the Right click on the project > Run As > Run on Server menu and add your project on the server you want to deploy it.
      Image:UML_to_JEE_-_First_Struts_Application_-_18_-_Run_on_server.png
    • 5.6 - It should work !
      Image:UML_to_JEE_-_First_Struts_Application_-_19_-_It_works_!.png

Our first hibernate application

Hibernate init files : http://acceleo.org/modules/pages/jee/input/org.acceleo.modules.pim.uml21.gen.java.hibernate.init.zip

Personal tools