Package com.opensymphony.module.sitemesh.factory

Examples of com.opensymphony.module.sitemesh.factory.FactoryException


            .getConstructor(new Class[] { com.opensymphony.module.sitemesh.Config.class });
        instance = (Factory) con.newInstance((Object[])new Config[] { config });
        config.getServletContext().setAttribute("sitemesh.factory",
            instance);
      } catch (Exception e) {
        throw new FactoryException("Cannot construct Factory : "
            + factoryClass, e);
      }
    }
    instance.refresh();
    return instance;
View Full Code Here


                    }
                }
            }
        }
        catch (ParserConfigurationException e) {
            throw new FactoryException("Could not get XML parser", e);
        }
        catch (IOException e) {
            throw new FactoryException("Could not read config file : " + configFileName, e);
        }
        catch (SAXException e) {
            throw new FactoryException("Could not parse config file : " + configFileName, e);
        }
    }
View Full Code Here

        Document doc = builder.parse(is);
        Element root = doc.getDocumentElement();
        // Verify root element
        if (!"sitemesh".equalsIgnoreCase(root.getTagName())) {
            throw new FactoryException("Root element of sitemesh configuration file not <sitemesh>", null);
        }
        return root;
    }
View Full Code Here

    Decorator result = null;
    if (request.getAttribute(DECORATOR) != null) {
      // Retrieve name of decorator to use from request
      String decoratorName = (String)request.getAttribute(DECORATOR);
      result = getNamedDecorator(request, decoratorName);
      if (result == null) throw new FactoryException("Cannot locate inline Decorator: " + decoratorName);
    }
    return result == null ? super.getDecorator(request, page) : result;
  }
View Full Code Here

                Class cls = ClassLoaderUtil.loadClass(factoryClass, config.getClass());
                Constructor con = cls.getConstructor(new Class[] { Config.class });
                instance = (Factory)con.newInstance(new Config[] { config });
                config.getServletContext().setAttribute(SITEMESH_FACTORY, instance);
            } catch (InvocationTargetException e) {
                throw new FactoryException("Cannot construct Factory : " + factoryClass, e.getTargetException());
       
            } catch (Exception e) {
                throw new FactoryException("Cannot construct Factory : " + factoryClass, e);
            }
        }
        instance.refresh();
        return instance;
    }
View Full Code Here

TOP

Related Classes of com.opensymphony.module.sitemesh.factory.FactoryException

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.