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

"controller class" command uses incorrect view name when "preferredMapping" contains uppercase characters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.2.0.M1
    • Fix Version/s: 1.2.0.RC1
    • Component/s: WEB MVC
    • Labels:
      None

      Description

      To replicate, run the "controller class" command with the "preferredMapping" option in mixed case, for example:

      controller class --class ~.web.Hello --preferredMapping helloApp

      1. The view name returned by the controller:

      Hello.java
      @RequestMapping
      public String index() {
          return "helloApp/index"; // this view name is in mixed case
      }

      ... does not match the view name in the Tiles views.xml file:

      src/main/webapp/WEB-INF/views/helloapp/views.xml
      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN" "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
      <tiles-definitions>
          <!-- This "name" attribute should also be in mixed case -->
          <definition extends="default" name="camelcase/index">
              <!-- The case of this filename only needs to match the file system -->
              <put-attribute name="body" value="/WEB-INF/views/camelcase/index.jspx"/>
          </definition>
      </tiles-definitions>

      2. Also, the relative URL in the relevant menu item is in lowercase instead of mixed case:

      src/main/webapp/WEB-INF/views/menu.jspx
      <menu:menu id="_menu" z="nZaf43BjUg1iM0v70HJVEsXDopc=">
          <menu:category id="c_controller" z="nj8Dm3hojIyIEyPkwE1UMDIs+K8=">
              <!-- The "url" attribute should be in mixed case -->
              <menu:item id="i_controller__helloappindex_id" messageCode="global_generic" url="/helloapp/index" z="vDuzy0/jMEErpBRrv8fulF3ZUEw="/>
          </menu:category>
      </menu:menu>

      The workaround is to fix the above problems manually.

        Attachments

          Activity

            People

            • Assignee:
              aswan Andrew Swan
              Reporter:
              awislowski Andrzej Wisłowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: