henning 2003/03/11 05:55:22
Modified: src/java/org/apache/turbine/modules/navigations
TemplateNavigation.java BaseJspNavigation.java
Log:
Convert to prefix usage
Revision Changes Path
1.4 +5 -4
jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/TemplateNavigation.java
Index: TemplateNavigation.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/TemplateNavigation.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TemplateNavigation.java 9 Mar 2003 02:41:46 -0000 1.3
+++ TemplateNavigation.java 11 Mar 2003 13:55:22 -0000 1.4
@@ -54,10 +54,10 @@
* <http://www.apache.org/>.
*/
-// Turbine/ECS Imports
-
import org.apache.ecs.ConcreteElement;
+
import org.apache.turbine.modules.Navigation;
+
import org.apache.turbine.util.RunData;
/**
@@ -66,7 +66,8 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Dave Bryson</a>
* @version $Id$
*/
-public abstract class TemplateNavigation extends Navigation
+public abstract class TemplateNavigation
+ extends Navigation
{
/**
* WebMacro Navigations extending this class should overide this
1.4 +25 -23
jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/BaseJspNavigation.java
Index: BaseJspNavigation.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/navigations/BaseJspNavigation.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseJspNavigation.java 9 Mar 2003 02:41:46 -0000 1.3
+++ BaseJspNavigation.java 11 Mar 2003 13:55:22 -0000 1.4
@@ -54,11 +54,12 @@
* <http://www.apache.org/>.
*/
-// ECS Classes
-
import org.apache.ecs.ConcreteElement;
-import org.apache.turbine.services.TurbineServices;
-import org.apache.turbine.services.jsp.JspService;
+
+import org.apache.turbine.TurbineConstants;
+
+import org.apache.turbine.services.jsp.TurbineJsp;
+
import org.apache.turbine.util.RunData;
/**
@@ -66,38 +67,39 @@
* use JSP. Subclasses should override the doBuildTemplate() method.
*
* @author <a href="mailto:[EMAIL PROTECTED]">John D. McNally</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Henning P. Schmiedehausen</a>
+ * @version $Id$
*/
-public class BaseJspNavigation extends TemplateNavigation
+public class BaseJspNavigation
+ extends TemplateNavigation
{
+ /** The prefix for lookup up navigation pages */
+ private String prefix = TurbineConstants.NAVIGATION_PREFIX + "/";
+
+ /**
+ * Method to be overidden by subclasses to include data in beans, etc.
+ *
+ * @param data, the Rundata object
+ */
+ protected void doBuildTemplate(RunData data)
+ throws Exception
+ {
+ }
+
/**
* Method that sets up beans and forward the request to the JSP.
*
* @param RunData
* @return null - the JSP sends the information
*/
- public ConcreteElement buildTemplate(RunData data) throws Exception
+ public ConcreteElement buildTemplate(RunData data)
+ throws Exception
{
- // set up any data in beans, etc
- doBuildTemplate(data);
-
// get the name of the JSP we want to use
String templateName = data.getTemplateInfo().getNavigationTemplate();
// navigations are used by a layout
- JspService jsp = (JspService)
- TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
- jsp.handleRequest(data, "/navigations/" + templateName);
-
+ TurbineJsp.handleRequest(data, prefix + templateName);
return null;
}
-
- /**
- * Method to be overidden by subclasses to include data in beans, etc.
- *
- * @param data, the Rundata object
- */
- protected void doBuildTemplate(RunData data) throws Exception
- {
- }
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]