Search in sources :

Example 1 with TilesRequestProcessor

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

the class RedeployableActionServlet method getRequestProcessor.

protected synchronized RequestProcessor getRequestProcessor(ModuleConfig config) throws ServletException {
    if (tileProcessor != null) {
        TilesRequestProcessor processor = (TilesRequestProcessor) super.getRequestProcessor(config);
        return processor;
    }
    // reset the request processor
    String requestProcessorKey = Globals.REQUEST_PROCESSOR_KEY + config.getPrefix();
    getServletContext().removeAttribute(requestProcessorKey);
    // create a new request processor instance
    TilesRequestProcessor processor = (TilesRequestProcessor) super.getRequestProcessor(config);
    tileProcessor = processor;
    try {
        // reload Tiles defs
        DefinitionsFactory factory = processor.getDefinitionsFactory();
        factory.init(factory.getConfig(), getServletContext());
    // System.out.println("reloaded tiles-definitions");
    } catch (DefinitionsFactoryException e) {
        e.printStackTrace();
    }
    return processor;
}
Also used : TilesRequestProcessor(org.apache.struts.tiles.TilesRequestProcessor) DefinitionsFactoryException(org.apache.struts.tiles.DefinitionsFactoryException) DefinitionsFactory(org.apache.struts.tiles.DefinitionsFactory)

Aggregations

DefinitionsFactory (org.apache.struts.tiles.DefinitionsFactory)1 DefinitionsFactoryException (org.apache.struts.tiles.DefinitionsFactoryException)1 TilesRequestProcessor (org.apache.struts.tiles.TilesRequestProcessor)1