Package org.apache.tiles

Examples of org.apache.tiles.TilesException


            Class contextClass = context.getClass();
            Method getInitParameterMethod =
                contextClass.getMethod("getInitParameter", String.class);
            value = getInitParameterMethod.invoke(context, parameterName);
        } catch (Exception e) {
            throw new TilesException("Unrecognized context.  Is this context" +
                " a ServletContext, PortletContext, or similar?", e);
        }
        return value == null ? null : value.toString();
    }
View Full Code Here


            while (e.hasMoreElements()) {
                String key = (String) e.nextElement();
                initParameters.put(key, (String) method.invoke(context, key));
            }
        } catch (Exception e) {
            throw new TilesException("Unable to retrieve init parameters." +
                " Is this context a ServletContext, PortletContext," +
                " or similar object?", e);
        }
        return initParameters;
    }
View Full Code Here

            return namedClass.newInstance();
        } catch (ClassNotFoundException e) {
            if(returnNull) {
                return null;
            }
            throw new TilesException("Unable to resolve factory class: '" + className + "'");
        } catch (IllegalAccessException e) {
            throw new TilesException("Unable to access factory class: '" + className + "'");
        } catch (InstantiationException e) {
            throw new TilesException("Unable to instantiate factory class: '"
                + className + "'. Make sure that this class has a default constructor");
        } finally {
            Thread.currentThread().setContextClassLoader(original);
        }
    }
View Full Code Here

            return;
        }

        if (attr == null) {
            if (name != null) {
                throw new TilesException("Attribute '" + name + "' not found.");
            } else {
                throw new TilesException("No attribute name or value has been provided.");
            }
        }
        render(attr);
    }
View Full Code Here

        root += tilesDefinitionName;

        if (container.isValidDefinition(root, request, response)) {
          result = root;
        } else {
          throw new TilesException("No defintion of found for " +
              "'" + root +"'" +
              " or '" + sb.toString() +"'");
        }
      }
View Full Code Here

            return;
        }

        if (attr == null) {
            if (name != null) {
                throw new TilesException("Attribute '" + name + "' not found.");
            } else {
                throw new TilesException("No attribute name or value has been provided.");
            }
        }
        render(attr);
    }
View Full Code Here

            return namedClass.newInstance();
        } catch (ClassNotFoundException e) {
            if (returnNull) {
                return null;
            }
            throw new TilesException("Unable to resolve factory class: '" + className + "'");
        } catch (IllegalAccessException e) {
            throw new TilesException("Unable to access factory class: '" + className + "'");
        } catch (InstantiationException e) {
            throw new TilesException("Unable to instantiate factory class: '"
                + className + "'. Make sure that this class has a default constructor");
        } finally {
            Thread.currentThread().setContextClassLoader(original);
        }
    }
View Full Code Here

        try {
            Class<?> contextClass = context.getClass();
            Method attrMethod = contextClass.getMethod("setAttribute", String.class, Object.class);
            attrMethod.invoke(context, name, value);
        } catch (Exception e) {
            throw new TilesException("Unable to set attribute for specified context: '" + context + "'");
        }
    }
View Full Code Here

        try {
            Class<?> contextClass = context.getClass();
            Method attrMethod = contextClass.getMethod("removeAttribute", String.class);
            attrMethod.invoke(context, name);
        } catch (Exception e) {
            throw new TilesException("Unable to remove attribute for specified context: '" + context + "'");
        }
    }
View Full Code Here

            Class<?> contextClass = context.getClass();
            Method getInitParameterMethod =
                contextClass.getMethod("getInitParameter", String.class);
            value = getInitParameterMethod.invoke(context, parameterName);
        } catch (Exception e) {
            throw new TilesException("Unrecognized context.  Is this context"
                    + " a ServletContext, PortletContext, or similar?", e);
        }
        return value == null ? null : value.toString();
    }
View Full Code Here

TOP

Related Classes of org.apache.tiles.TilesException

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.