Examples of ViewPreparer


Examples of org.apache.tiles.preparer.ViewPreparer


  @Override
  protected ViewPreparer getPreparer(String name, WebApplicationContext context) throws TilesException {
    // Quick check on the concurrent map first, with minimal locking.
    ViewPreparer preparer = this.sharedPreparers.get(name);
    if (preparer == null) {
      synchronized (this.sharedPreparers) {
        preparer = this.sharedPreparers.get(name);
        if (preparer == null) {
          try {
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

*/
public class CompatibilityPreparerFactory extends BasicPreparerFactory {

    /** {@inheritDoc} */
    protected ViewPreparer createPreparer(String name) {
        ViewPreparer retValue;

        if (name.startsWith("/")) {
            retValue = new UrlPreparer(name);
        } else {
            retValue = super.createPreparer(name);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

*/
public class CompatibilityPreparerFactory extends BasicPreparerFactory {

    /** {@inheritDoc} */
    protected ViewPreparer createPreparer(String name) {
        ViewPreparer retValue;

        if (name.startsWith("/")) {
            retValue = new UrlPreparer(name);
        } else {
            retValue = super.createPreparer(name);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

        if (log.isDebugEnabled()) {
            log.debug("Prepare request received for '" + preparerName);
        }

        ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

     */
    private void prepare(TilesContainer container, TilesRequestContext context, String preparerName, boolean ignoreMissing) throws TilesException {
        if (log.isDebugEnabled()) {
            log.debug("Prepare request received for '" + preparerName);
        }
        ViewPreparer preparer = ((BasicTilesContainer)container).getPreparerFactory().getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }
        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }
        AttributeContext attributeContext = BasicAttributeContext.getContext(context);
        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

        if (LOG.isDebugEnabled()) {
            LOG.debug("Prepare request received for '" + preparerName);
        }

        ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = BasicAttributeContext.getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

public class CompatibilityPreparerFactory extends BasicPreparerFactory {

    /** {@inheritDoc} */
    @Override
    protected ViewPreparer createPreparer(String name) {
        ViewPreparer retValue;

        if (name.startsWith("/")) {
            retValue = new UrlPreparer(name);
        } else {
            retValue = super.createPreparer(name);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

     */
    private void prepare(Request context, String preparerName, boolean ignoreMissing) {

        log.debug("Prepare request received for '{}'", preparerName);

        ViewPreparer preparer = preparerFactory.getPreparer(preparerName, context);
        if (preparer == null && ignoreMissing) {
            return;
        }

        if (preparer == null) {
            throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
        }

        AttributeContext attributeContext = getContext(context);

        preparer.execute(context, attributeContext);
    }
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

     * Test method for
     * {@link org.apache.tiles.compat.preparer.CompatibilityPreparerFactory#createPreparer(java.lang.String)}
     * .
     */
    public void testCreatePreparer() {
        ViewPreparer preparer = factory.createPreparer("/my/url.do");
        assertTrue("The preparer is not an UrlPreparer",
                preparer instanceof UrlPreparer);
        preparer = factory.createPreparer(MockViewPreparer.class.getName());
        assertTrue("The preparer is not an class ViewPreparer",
                preparer instanceof MockViewPreparer);
View Full Code Here

Examples of org.apache.tiles.preparer.ViewPreparer

    /**
     * Tests getting a preparer.
     */
    public void testGetPreparer() {
        String name = MockViewPreparer.class.getName();
        ViewPreparer p = factory.getPreparer(name, null);
        assertNotNull(p);
        assertTrue(p instanceof MockViewPreparer);

        name = "org.doesnotexist.Class";
        p = factory.getPreparer(name, null);
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.