Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-2854

The web jsf all command generated ManagedBean's init() method is incomplete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.2.0.M1
    • Fix Version/s: 1.2.0.RC1
    • Component/s: JSF
    • Labels:
    • Environment:
      osx 10.6.8
      jdk 1.6.0_26
      cargo: tomcat 7.0.22

      Description

      If you generate a jsf UI and deploy it, and than click on any "List all" menu item
      you will see an empty list even if there are entries in the DB.

      Once you use the "Create" menu item, suddenly you can see all items. So let say you have
      5 entries in the DB, when you restart tomcat and click on "List all" you see an empty table,
      than if you create one new with "Create", than you will see a table with 6 rows.

      In the generated ManagedBean's persist() and delete() methods include a call to findAllXXX()
      but the init() method missing it.

      If you modify addon-jsf/src/main/java/org/springframework/roo/addon/jsf/managedbean/JsfManagedBeanMetadata.java
      by adding 1 line in getInitMethod(), around line 333:

      bodyBuilder.appendFormalLine("findAll" + plural + "();");

      this is fixing the bug.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            lalyos lajos papp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: