You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Youngho Cho <yo...@nannet.co.kr> on 2001/04/03 05:09:27 UTC

[Pacth] Re: cvs commit: jakarta-turbine/src/java/org/apache/turbine Turbine.java

Hi ,

I'm not sure is it right way or not,

But it seems to work fine.

Thanks,

youngho

Index: TurbineTemplateService.java
===================================================================
RCS file: /home/cvspublic/jakarta-turbine/src/java/org/apache/turbine/services/template/TurbineTemplateService.java,v
retrieving revision 1.31
diff -u -r1.31 TurbineTemplateService.java

 
@@ -797,16 +797,21 @@
      */
     public String getDefaultPageName(RunData data)
     {
-        String template = data.getParameters().get("template");        
-        
-        TemplateEngineService tes = 
+        String template = data.getParameters().get("template");
+
+        if ( template == null)
+        {
+            return null;
+        }
+
+        TemplateEngineService tes =
             getTemplateEngineService(template);
-        
+
         if (tes == null)
         {
             return null;
-        }            
-        
+        }
+
         return (String) tes.getTemplateEngineServiceConfiguration()
             .get(TemplateEngineService.DEFAULT_PAGE);
     }
@@ -816,16 +821,21 @@
      */
     public String getDefaultLayoutName(RunData data)
     {
-        String template = data.getParameters().get("template");        
-        
-        TemplateEngineService tes = 
+        String template = data.getParameters().get("template");
+
+        if ( template == null)
+        {
+            return null;
+        }
+
+        TemplateEngineService tes =
             getTemplateEngineService(template);
-        
+
         if (tes == null)
         {
             return null;
-        }            
-        
+        }
+
         return (String) tes.getTemplateEngineServiceConfiguration()
             .get(TemplateEngineService.DEFAULT_LAYOUT);
     }