You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "sean schofield (JIRA)" <in...@incubator.apache.org> on 2005/03/29 22:00:17 UTC

[jira] Created: (MYFACES-150) JspTilesViewHandlerImpl requires tiles definitions to end in '.tiles'

JspTilesViewHandlerImpl requires tiles definitions to end in '.tiles'
---------------------------------------------------------------------

         Key: MYFACES-150
         URL: http://issues.apache.org/jira/browse/MYFACES-150
     Project: MyFaces
        Type: Improvement
    Versions: 1.0.7 beta, 1.0.8 beta    
    Reporter: sean schofield
    Priority: Minor


Currently ever tiles definition *must* end in *.tiles.  This is too restrictive.  I'm including a patch that allows the user to specify their own suffix.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-150) JspTilesViewHandlerImpl requires tiles definitions to end in '.tiles'

Posted by "sean schofield (JIRA)" <in...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-150?page=comments#action_61767 ]
     
sean schofield commented on MYFACES-150:
----------------------------------------

Index: src/components/org/apache/myfaces/application/jsp/JspTilesViewHandlerImpl.java
===================================================================
RCS file: /home/cvspublic/incubator-myfaces/src/components/org/apache/myfaces/application/jsp/JspTilesViewHandlerImpl.java,v
retrieving revision 1.12
diff -u -r1.12 JspTilesViewHandlerImpl.java
--- src/components/org/apache/myfaces/application/jsp/JspTilesViewHandlerImpl.java	22 Dec 2004 08:12:36 -0000	1.12
+++ src/components/org/apache/myfaces/application/jsp/JspTilesViewHandlerImpl.java	29 Mar 2005 19:28:25 -0000
@@ -86,9 +86,11 @@
     private static final Log log = LogFactory.getLog(JspTilesViewHandlerImpl.class);
     private static final String TILES_EXTENSION = ".tiles";
     private static final String TILES_DEF_ATTR = "tiles-definitions";
+    private static final String TILES_EXT_ATTR = "tiles-extension";
 
     private DefinitionsFactory _definitionsFactory;
-
+    private String tilesExtension = TILES_EXTENSION;
+    
     public JspTilesViewHandlerImpl(ViewHandler viewHandler)
     {
         _viewHandler = viewHandler;
@@ -107,6 +109,16 @@
                           + TILES_DEF_ATTR + " param in your web.xml");
                 return null;
             }
+            
+            String tilezExtension = context.getInitParameter(TILES_EXT_ATTR);
+            if (tilezExtension != null)
+            {
+                tilesExtension = tilezExtension;
+                if (log.isDebugEnabled())
+                {
+                    log.debug("Using non-default tiles extension of: " + tilesExtension);
+                }
+            }
 
             DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
             factoryConfig.setDefinitionConfigFiles(tilesDefinitions);
@@ -169,11 +181,11 @@
         int idx = tilesId.lastIndexOf('.');
         if (idx > 0)
         {
-            tilesId = tilesId.substring(0, idx) + TILES_EXTENSION;
+            tilesId = tilesId.substring(0, idx) + tilesExtension;
         }
         else
         {
-            tilesId = tilesId  + TILES_EXTENSION;
+            tilesId = tilesId  + tilesExtension;
         }
         ServletRequest request = (ServletRequest)externalContext.getRequest();
         ServletContext servletContext = (ServletContext)externalContext.getContext();

> JspTilesViewHandlerImpl requires tiles definitions to end in '.tiles'
> ---------------------------------------------------------------------
>
>          Key: MYFACES-150
>          URL: http://issues.apache.org/jira/browse/MYFACES-150
>      Project: MyFaces
>         Type: Improvement
>     Versions: 1.0.7 beta, 1.0.8 beta
>     Reporter: sean schofield
>     Priority: Minor

>
> Currently ever tiles definition *must* end in *.tiles.  This is too restrictive.  I'm including a patch that allows the user to specify their own suffix.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira