You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2003/02/28 15:18:34 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts JspLayout.java
henning 2003/02/28 06:18:33
Modified: src/java/org/apache/turbine/modules/layouts JspLayout.java
Log:
Cleaned up the code a little. Now using the Facade to execute the Jsp.
Revision Changes Path
1.4 +15 -8 jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/JspLayout.java
Index: JspLayout.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/layouts/JspLayout.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JspLayout.java 12 Feb 2003 17:52:17 -0000 1.3
+++ JspLayout.java 28 Feb 2003 14:18:33 -0000 1.4
@@ -55,10 +55,13 @@
*/
import org.apache.turbine.modules.Layout;
+
import org.apache.turbine.services.TurbineServices;
-import org.apache.turbine.services.jsp.JspService;
+
+import org.apache.turbine.services.jsp.TurbineJsp;
import org.apache.turbine.services.jsp.util.JspNavigation;
import org.apache.turbine.services.jsp.util.JspScreenPlaceholder;
+
import org.apache.turbine.util.RunData;
/**
@@ -67,8 +70,10 @@
* navigations there should be relatively few reasons to subclass this Layout.
*
* @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
+ * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
*/
-public class JspLayout extends Layout
+public class JspLayout
+ extends Layout
{
/**
* Method called by LayoutLoader.
@@ -76,21 +81,23 @@
* @param data RunData
* @throws Exception generic exception
*/
- public void doBuild(RunData data) throws Exception
+ public void doBuild(RunData data)
+ throws Exception
{
data.getResponse().setContentType("text/html");
data.declareDirectResponse();
+
// variable to reference the screen in the layout template
data.getRequest().setAttribute("screen_placeholder",
new JspScreenPlaceholder(data));
+
// variable to reference the navigations in the layout template
- data.getRequest().setAttribute("navigation", new JspNavigation(data));
+ data.getRequest().setAttribute("navigation",
+ new JspNavigation(data));
// Grab the layout template set in the TemplatePage.
String templateName = data.getTemplateInfo().getLayoutTemplate();
- // Finally, generate the layout template and output to the response
- JspService jsp = (JspService) TurbineServices.getInstance()
- .getService(JspService.SERVICE_NAME);
- jsp.handleRequest(data, "/layouts" + templateName, true);
+
+ TurbineJsp.handleRequest(data, "/layouts" + templateName, true);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org