Uploaded image for project: 'Tiles'
  1. Tiles
  2. TILES-340

Wildcards and some combinations of locale fails to find definition

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0, 2.1.3, 2.2.0
    • 2.1.4, 2.2.0
    • tiles-core
    • None
    • Glassfish v2, Spring 2.5, Linux (opensuse 11)

    Description

      I have the following definition:

      <definition name="standardLayout" template="/WEB-INF/layouts/standard.jspx" />
      
      <definition name="*/*" extends="standardLayout">
              <put-attribute name="body" value="/WEB-INF/jspx/{1}/{2}.jspx" />
      </definition>
      

      So I set Firefox to use English/United States [en-us] and open a page that matches the wildcard. This works fine. Then I change the language setting in Firefox to English [en], and open the same page. Then I get an exception:

      Dec 10, 2008 9:52:10 AM org.apache.tiles.impl.BasicTilesContainer render
      WARNING: Unable to find the definition 'hjem/start'
      Dec 10, 2008 9:52:10 AM org.apache.tiles.impl.BasicTilesContainer render
      WARNING: Unable to find the definition 'feil/500'
      Dec 10, 2008 9:52:10 AM org.apache.catalina.core.StandardWrapperValve log
      SEVERE: StandardWrapperValve[tiles]: PWC1406: Servlet.service() for servlet tiles threw exception
      org.apache.tiles.definition.NoSuchDefinitionException: feil/500
      	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:612)
      	at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:307)
      	at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:75)
      	at org.springframework.js.ajax.tiles2.AjaxTilesView.renderMergedOutputModel(AjaxTilesView.java:108)
      	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:257)
      	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1183)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
      	at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
      	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
      	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
      	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
      	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
      	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
      	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
      	at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
      	at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
      	at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
      	at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
      	at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
      	at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
      	at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
      	at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      

      This works the same with other languages that has sub-languages as well. Like Spanish/Chile [es-cl] works, and Spanish [es] fails. German/Germany [de-de] works, German [de] fails.
      But: if I do this the other way around, it works! Open the page with English [en] works, then I open with English/United States [en-us] and it works too. Very strange.

      And if I don't use wildcards for the definition, then it works no matter what. With Tiles 2.1.0 and 2.0.6.

      Attachments

        1. TilesTest.tar.gz
          4 kB
          Antonio Petrelli
        2. TilesTest.tar.gz
          3 kB
          Christian Ihle
        3. TilesTest-0.1.war
          4.08 MB
          Christian Ihle

        Activity

          People

            brenmcguire Antonio Petrelli
            christiani Christian Ihle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: