Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspContext


    }

    /** {@inheritDoc} */
    @Override
    public void doTag() throws JspException, IOException {
        JspContext jspContext = getJspContext();
        model.start(JspUtil.getCurrentContainer(jspContext), jspContext);
        JspUtil.evaluateFragment(getJspBody());
        model.end(JspUtil.getCurrentContainer(jspContext), template,
                templateType, templateExpression, role, preparer, jspContext);
    }
View Full Code Here


    }

    /** {@inheritDoc} */
    @Override
    public void doTag() throws JspException, IOException {
        JspContext jspContext = getJspContext();
        model.start(JspUtil.getComposeStack(jspContext), JspUtil
                .getCurrentContainer(jspContext), ignore, preparer, role,
                defaultValue, defaultValueRole, defaultValueType, name,
                (Attribute) value, jspContext);
        JspUtil.evaluateFragment(getJspBody());
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public void doTag() throws JspException, IOException {
        JspContext jspContext = getJspContext();
        model.start(JspUtil.getComposeStack(jspContext), JspUtil
                .getCurrentContainer(jspContext), ignore, preparer, role,
                defaultValue, defaultValueRole, defaultValueType, name,
                (Attribute) value, jspContext);
        JspWriter writer = jspContext.getOut();
        JspUtil.evaluateFragment(getJspBody());
        model.end(JspUtil.getComposeStack(jspContext), JspUtil
                .getCurrentContainer(jspContext), writer, ignore,
                jspContext);
        if(isFlush()){
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public void doTag() throws JspException {
        JspContext jspContext = getJspContext();
        Map<String, Object> attributes = model.getImportedAttributes(JspUtil
                .getCurrentContainer(jspContext), name, toName, ignore,
                jspContext);
        int scopeId = JspUtil.getScope(scopeName);
        for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            jspContext.setAttribute(entry.getKey(), entry.getValue(), scopeId);
        }
    }
View Full Code Here

    public void doTag() throws JspException, IOException {
        String formatted =
            new SimpleDateFormat("long".equals(format)?"EEE 'the' d:MMM:yyyy":"d:MM:yy")
            .format(new Date());
        StringTokenizer tok = new StringTokenizer(formatted,":");
        JspContext context = getJspContext();
        context.setAttribute("day", tok.nextToken() );
        context.setAttribute("month", tok.nextToken() );
        context.setAttribute("year", tok.nextToken() );

        JspFragment fragment = getJspBody();
        fragment.invoke(null);
    }
View Full Code Here

    }

    @Test
    public void testCreateModelBody() {
        JspFragment jspBody = createMock(JspFragment.class);
        JspContext jspContext = createMock(JspContext.class);
        JspTag parent = createMock(JspTag.class);
        JspWriter writer = createMock(JspWriter.class);
        expect(jspContext.getOut()).andReturn(writer);
        replay(jspBody, jspContext, parent, writer);
        JspAutotagRuntime runtime = new JspAutotagRuntime();
        runtime.setJspBody(jspBody);
        runtime.setJspContext(jspContext);
        runtime.setParent(parent);
View Full Code Here

    }

    @Test(expected = UnsupportedOperationException.class)
    public void testGetParameter() {
        JspFragment jspBody = createMock(JspFragment.class);
        JspContext jspContext = createMock(JspContext.class);
        JspTag parent = createMock(JspTag.class);
        replay(jspBody, jspContext, parent);
        JspAutotagRuntime runtime = new JspAutotagRuntime();
        runtime.setJspBody(jspBody);
        runtime.setJspContext(jspContext);
View Full Code Here

    }

    /** {@inheritDoc} */
    @Override
    public Request createRequest() {
        JspContext pageContext = getJspContext();
        return JspRequest.createServletJspRequest(org.apache.tiles.request.jsp.JspUtil.getApplicationContext(pageContext),
                                                  (PageContext) pageContext);
    }
View Full Code Here

        this.bodyLoopCount = bodyLoopCount;
    }
   
    public void doTag() throws JspException, IOException
    {
        JspContext ctx = getJspContext();
        JspWriter w = ctx.getOut();
        w.println("enter TestSimpleTag " + name);
        JspFragment f = getJspBody();
        for(int i = 0; i < bodyLoopCount; ++i)
        {
            w.println("invoking body i=" + i);
View Full Code Here

        List allElements = domainTypeConfiguration.getRepository().findAll();
        allElements = sortByNaturalOrder(allElements, domainTypeConfiguration);

        PersistentProperty idAttribute = domainTypeConfiguration.getPersistentEntity().getIdProperty();
        EntityNameExtractor<Object> nameExtractor = domainTypeConfiguration.getEntityConfiguration().getNameExtractor();
        JspContext jspContext = getJspContext();
        JspFragment tagBody = getJspBody();
        for (Object element : allElements) {
            BeanWrapper beanWrapper = new DirectFieldAccessFallbackBeanWrapper(element);

            jspContext.setAttribute(idVar, beanWrapper.getPropertyValue(idAttribute.getName()));
            jspContext.setAttribute(stringRepresentationVar, exceptionAwareNameExtractor(nameExtractor, domainTypeConfiguration).apply(element));
            tagBody.invoke(null);
        }
    }
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.JspContext

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.