1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.modules.pages;
18
19
20
21 import org.apache.jetspeed.util.template.JetspeedTemplateNavigation;
22
23
24 import org.apache.turbine.util.RunData;
25 import org.apache.turbine.services.jsp.JspService;
26 import org.apache.turbine.services.TurbineServices;
27 import org.apache.turbine.services.velocity.VelocityService;
28 import org.apache.turbine.services.velocity.TurbineVelocity;
29 import org.apache.velocity.context.Context;
30
31 /***
32 * Same as turbine's JspPage, only that it extends JetspeedTemplatePage.
33 * Adds some convenience objects to the request.
34 *
35 * @author <a href="mailto:ingo@raleigh.ibm.com">Ingo Schuster</a>
36 * @version $Revision: 1.7 $
37 */
38 public class JetspeedJspPage extends JetspeedTemplatePage
39 {
40
41 /***
42 * Same method as in turbine's JspPage
43 * Stuffs some useful objects into the request so that
44 * it is available to the Action module and the Screen module
45 */
46 protected void doBuildBeforeAction(RunData data) throws Exception
47 {
48 super.doBuildBeforeAction( data);
49 JspService jsp = (JspService)TurbineServices.getInstance()
50 .getService(JspService.SERVICE_NAME);
51
52 jsp.addDefaultObjects(data);
53
54 data.getResponse().setBufferSize(jsp.getDefaultBufferSize());
55
56
57
58
59
60 Context context = TurbineVelocity.getContext(data);
61 TurbineVelocity.getContext(data).put("jnavigation", new JetspeedTemplateNavigation(data));
62 data.getTemplateInfo().setTemplateContext(VelocityService.CONTEXT, context);
63
64 }
65
66 }