Package org.apache.bsf

Examples of org.apache.bsf.BSFManager.declareBean()


        }

        bsfManager.declareBean("application", application,
                ServletContext.class);

        bsfManager.declareBean("log", LOG, Log.class);
        StrutsInfo struts = new StrutsInfo(this, mapping, form,
                getResources(request));
        bsfManager.declareBean("struts", struts, StrutsInfo.class);

        for (int x = 0; x < filters.length; x++) {
View Full Code Here


                ServletContext.class);

        bsfManager.declareBean("log", LOG, Log.class);
        StrutsInfo struts = new StrutsInfo(this, mapping, form,
                getResources(request));
        bsfManager.declareBean("struts", struts, StrutsInfo.class);

        for (int x = 0; x < filters.length; x++) {
            filters[x].apply(bsfManager);
        }
View Full Code Here

            BSFManager bsfman = new BSFManager();

            try
            {
                WebContext context = WebContextFactory.get();
                bsfman.declareBean("context", context, context.getClass());
            }
            catch (BSFException ex)
            {
                log.warn("Failed to register WebContext with scripting engine: " + ex.getMessage());
            }
View Full Code Here

        final BSFManager manager = new BSFManager();
        for (Iterator i = fBeans.keySet().iterator(); i.hasNext();) {
            final String key = (String) i.next();
            final Object value = fBeans.get(key);
            if (value != null) {
                manager.declareBean(key, value, value.getClass());
            } else {
                // BSF uses a hashtable to store values
                // so cannot declareBean with a null value
                // So need to remove any bean of this name as
                // that bean should not be visible
View Full Code Here

            // create the BSF manager
            BSFManager bsfManager = new BSFManager();
            bsfManager.setClassLoader(cl);

            // expose the event objects to the script
            bsfManager.declareBean("request", request, HttpServletRequest.class);
            bsfManager.declareBean("response", response, HttpServletResponse.class);

            // get the script type
            String scriptType = BSFManager.getLangFromFilename(event.invoke);
View Full Code Here

            BSFManager bsfManager = new BSFManager();
            bsfManager.setClassLoader(cl);

            // expose the event objects to the script
            bsfManager.declareBean("request", request, HttpServletRequest.class);
            bsfManager.declareBean("response", response, HttpServletResponse.class);

            // get the script type
            String scriptType = BSFManager.getLangFromFilename(event.invoke);

            // load the script
View Full Code Here

        try
        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
View Full Code Here

        try
        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
                location.getResourceLocation().toString(),
View Full Code Here

        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
                location.getResourceLocation().toString(),
                location.getLineNumber(),
View Full Code Here

            mgr = getManager();
            if (mgr == null) {
                log.error("Problem creating BSF manager");
                return;
            }
            mgr.declareBean("sampleEvent", event, SampleEvent.class);
            SampleResult result = event.getResult();
            mgr.declareBean("sampleResult", result, SampleResult.class);
            processFileOrScript(mgr);
        } catch (BSFException e) {
            log.warn("Problem in BSF script "+e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.