Grails
  1. Grails
  2. GRAILS-8966

Sitemesh layout is applied twice to error views handled by a controller

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Testcase included:
      yes

      Description

      If you have a URL mapping like:

      "404"(controller:'error', action:'notFound')
      

      ...and action and view like:

          def notFound() {
              render view: '404'
          }
      
      <!doctype html>
      <html>
      	<head>
      		<meta name="layout" content="main"/>
      		<title>FOUR OH FOUR!</title>
      	</head>
      	<body>
      	    This is the 404 page
          </body>
      </html>
      

      ...what you find is the site mesh layout is executed twice in some way. This is noticeable if main.gsp layout uses 2x <r:layoutResources/> calls - it crashes as it tries to execute the third call for the request, to let you know something is wrong.

      This does not happen if your URL mapping points straight to view 404.gsp view - it only happens if pointing at the controller.

      See attached app - browse to http://localhost:8080/G201Sitemesh/somebullshit

        Issue Links

          Activity

          Hide
          Graeme Rocher added a comment -

          duplicates GRAILS-8904

          Show
          Graeme Rocher added a comment - duplicates GRAILS-8904
          Hide
          Donal Murtagh added a comment -

          Related issue with workaround http://jira.grails.org/browse/GRAILS-1844

          Show
          Donal Murtagh added a comment - Related issue with workaround http://jira.grails.org/browse/GRAILS-1844

            People

            • Assignee:
              Unassigned
              Reporter:
              Marc Palmer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development