Announcement Announcement Module
Collapse
No announcement yet.
Customize mvc controller using Roo Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Customize mvc controller using Roo

    Hi Guys,

    In the Spring Roo pizza tutorial there is a model class called PizzaOrder.java.
    I noticed the controller logic for PizzaOrder isn't inside PizzaOrderController.java, but instead is contained in PizzaOrderController_Roo_Controller.aj.

    I want to be able to create custom methods for the controller. I realize that we are not supposed to edit PizzaOrderController_Roo_Controller.aj directly as stated at the top of the file "// WARNING: DO NOT EDIT THIS FILE. THIS FILE IS MANAGED BY SPRING ROO.
    // You may push code into the target .java compilation unit if you wish to edit any member(s)."

    I assume this means I need to add any custom methods to the PizzaOrderController.java. That is the "target .java compilation unit" they are referring to, correct? If anyone could point me to an example of this I would really appreciate it!

    Thanks,
    Jack

  • #2
    What you need is to 'push-in' the code / methods you wish to customize. If your project is in STS you can simply use Refactor > Push In otherwise you can simply copy the relevant method from the .aj file to the .java source and adjust the method signature (ie remove the target type name from the method name).

    HTH,
    Stefan

    Comment


    • #3
      Hey Stefan,

      Sorry for the late reply. Thanks for the tip though. I'll give this a try.

      Jack

      Comment


      • #4
        hi Guys

        is there any documents on this, or sample

        placi.

        Comment


        • #5
          hi Stefan

          can you give more detail how to push-in works in STS.

          placi.

          Comment

          Working...
          X