Search in sources :

Example 1 with DefinitionsFactoryConfig

use of org.apache.struts.tiles.DefinitionsFactoryConfig in project sonar-java by SonarSource.

the class InitDefinitionsTag method doStartTag.

/**
 * Do start tag.
 */
public int doStartTag() throws JspException {
    DefinitionsFactory factory = TilesUtil.getDefinitionsFactory(pageContext.getRequest(), pageContext.getServletContext());
    if (factory != null)
        return SKIP_BODY;
    DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
    factoryConfig.setFactoryClassname(classname);
    factoryConfig.setDefinitionConfigFiles(filename);
    try {
        factory = TilesUtil.createDefinitionsFactory(pageContext.getServletContext(), factoryConfig);
    } catch (DefinitionsFactoryException ex) {
        ex.printStackTrace();
        throw new JspException(ex);
    }
    return SKIP_BODY;
}
Also used : JspException(javax.servlet.jsp.JspException) DefinitionsFactoryConfig(org.apache.struts.tiles.DefinitionsFactoryConfig) DefinitionsFactoryException(org.apache.struts.tiles.DefinitionsFactoryException) DefinitionsFactory(org.apache.struts.tiles.DefinitionsFactory)

Aggregations

JspException (javax.servlet.jsp.JspException)1 DefinitionsFactory (org.apache.struts.tiles.DefinitionsFactory)1 DefinitionsFactoryConfig (org.apache.struts.tiles.DefinitionsFactoryConfig)1 DefinitionsFactoryException (org.apache.struts.tiles.DefinitionsFactoryException)1