Package org.apache.turbine.services.jsp

Examples of org.apache.turbine.services.jsp.JspService


     * Stuffs some useful objects into the request so that
     * it is available to the Action module and the Screen module
     */
    protected void doBuildBeforeAction(RunData data) throws Exception
    {
        JspService jsp = (JspService)TurbineServices.getInstance()
            .getService(JspService.SERVICE_NAME);

        jsp.addDefaultObjects(data);
        try
        {
            //We try to set the buffer size from defaults
            data.getResponse().setBufferSize(jsp.getDefaultBufferSize());
        }
        catch (IllegalStateException ise )
        {
            //If the response was already commited, we die silently
            //No logger here?
View Full Code Here


        {
            templateName = '/' + templateName;
        }

        // let service know whether we are using a layout
        JspService jsp = (JspService)
            TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
        jsp.handleRequest(data, "/screens" + templateName,
                          getLayout(data) == null);

        return null;
    }
View Full Code Here

       
        String module = null;
        String template = null;
        Boolean flag = (Boolean)pageContext
                .getAttribute(FLAG, PageContext.REQUEST_SCOPE);
        JspService jsp = (JspService) TurbineServices.getInstance()
            .getService(JspService.SERVICE_NAME);
        try
       
            pageContext.getOut().flush();
            template = data.getTemplateInfo().getScreenTemplate();
           
            if ( staticContent || (flag != null && flag.booleanValue()) )
            {
                jsp.handleRequest(data, "/screens/" + template, false);
            }
            else
            {
                module = ((TemplateService)TurbineServices.getInstance().getService(
                TemplateService.SERVICE_NAME)).getScreenName(template);
View Full Code Here

        this.templateName = templateName;
    }

    public String getContent()
    {
        JspService jsp = (JspService) TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
        try
        {
            jsp.handleRequest(this.runData, this.templateName);
        }
        catch (TurbineException te1)
        {
            if (!this.templateName.endsWith(".jsp"))
            {
                try
                {
                    jsp.handleRequest(this.runData, this.templateName + ".jsp");
                }
                catch (TurbineException te2)
                {
                    logger.error("failed to invoke JSP Template '" +
                                    this.templateName + "' and '" + this.templateName + ".jsp'", te2);
View Full Code Here

    public String getContent(RunData data, String name, String value, Map parms)
    {
        String result = null;

        // Get reference to jsp service
        JspService jspService = (JspService) TurbineServices.getInstance().getService(JspService.SERVICE_NAME);

        // Put basics in the context
        data.getRequest().setAttribute("data", data);
        data.getRequest().setAttribute("name", name);
        data.getRequest().setAttribute("value", value);
        data.getRequest().setAttribute("parms", parms);
        data.getRequest().setAttribute("events", this.getJavascriptEvents());

        try
        {
      // Put all style parameters in the context   
      for (Iterator it = parms.keySet().iterator(); it.hasNext();)
      {
        String key = (String) it.next();
        data.getRequest().setAttribute(key, parms.get(key));
      }
         
            // Add custom objects to the context
            this.buildContext(data, name, value, parms);

            // Build default template name (classname + .vm)
            String className = this.getClass().getName();
            int pos = className.lastIndexOf(".");
            pos = pos < 0 ? 0 : pos + 1;
            className = className.substring(pos);

            // Render the template
            String template = (String) this.getParm("template", className + ".jsp");
            String templatePath = TemplateLocator.locateParameterTemplate(data, template);
            jspService.handleRequest(data, templatePath);
            result = "";
        }
        catch (Exception e)
        {
            logger.error("Exception", e);
View Full Code Here

                        locatedTemplate = "/screens" + locatedTemplate;
                    }
                    logger.debug("JSPViewProcessor - located screen template: " + locatedTemplate);
                } */

                JspService service = (JspService) ServiceUtil.getServiceByName(JspService.SERVICE_NAME);

                // this is only necessary if we don't run in a JSP page environment
                // but better be safe than sorry...
                service.addDefaultObjects(data);

                // handle request
                service.handleRequest(data, locatedTemplate);

            }
            else
            {
                // Build parameter list to be passed with the jsp
View Full Code Here

     * it is available to the Action module and the Screen module
     */ 
    protected void doBuildBeforeAction(RunData data) throws Exception
    {
        super.doBuildBeforeAction( data);
        JspService jsp = (JspService)TurbineServices.getInstance()
            .getService(JspService.SERVICE_NAME);
               
        jsp.addDefaultObjects(data);

        data.getResponse().setBufferSize(jsp.getDefaultBufferSize());

        // FIXME: this tools are now in TR.p file, as standard request tools instantiated by turbine.
        // All tools but jnavigation are there, jnavigation need to be instantiated here
        // because TemplateNavigation in which depends does have a no args constructor..and
        // turbine need one to be able to instantiate such class as request tool
View Full Code Here

    public String getContent(RunData data, String name, String value, Map parms)
    {
        String result = null;

        // Get reference to jsp service
        JspService jspService = (JspService) TurbineServices.getInstance().getService(JspService.SERVICE_NAME);

        // Put basics in the context
        data.getRequest().setAttribute("data", data);
        data.getRequest().setAttribute("name", name);
        data.getRequest().setAttribute("value", value);
        data.getRequest().setAttribute("parms", parms);
        data.getRequest().setAttribute("events", this.getJavascriptEvents());

        try
        {
            // Add custom objects to the context
            this.buildContext(data, name, value, parms);

            // Build default template name (classname + .vm)
            String className = this.getClass().getName();
            int pos = className.lastIndexOf(".");
            pos = pos < 0 ? 0 : pos + 1;
            className = className.substring(pos);

            // Render the template
            String template = (String) this.getParm("template", className + ".jsp");
            String templatePath = TemplateLocator.locateParameterTemplate(data, template);
            jspService.handleRequest(data, templatePath);
            result = "";
        }
        catch (Exception e)
        {
            logger.error("Exception", e);
View Full Code Here

                        locatedTemplate = "/screens" + locatedTemplate;
                    }
                    logger.debug("JSPViewProcessor - located screen template: " + locatedTemplate);
                } */

                JspService service = (JspService) ServiceUtil.getServiceByName(JspService.SERVICE_NAME);

                // this is only necessary if we don't run in a JSP page environment
                // but better be safe than sorry...
                service.addDefaultObjects(data);

                // handle request
                service.handleRequest(data, locatedTemplate);

            }
            else
            {
                // Build parameter list to be passed with the jsp
View Full Code Here

                        locatedTemplate = "/screens" + locatedTemplate;
                    }
                    Log.debug("JSPViewProcessor - located screen template: " + locatedTemplate);
                } */

                JspService service = (JspService) ServiceUtil.getServiceByName(JspService.SERVICE_NAME);

                // this is only necessary if we don't run in a JSP page environment
                // but better be safe than sorry...
                service.addDefaultObjects(data);

                // handle request
                service.handleRequest(data, locatedTemplate);

            }
            else
            {
                // Build parameter list to be passed with the jsp
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.jsp.JspService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.