Re: Weblogic prettyfaces deployment problem

Splash Forums PrettyFaces Users Weblogic prettyfaces deployment problem Re: Weblogic prettyfaces deployment problem

#21900

rfsonge22
Member

To come around this problem on WebLogic 12c I had to change the way pretty parses the web.xml. In the method parse(ServletContext ) in class com.ocpsoft.pretty.faces.config.servlet.WebXmlParser.java, I commented out the code witch uses context.getServletRegistrations(), and used the digester parsing instead.


public void parse(final ServletContext context) throws IOException, SAXException
{
// if (context.getMajorVersion() >= 3)
// {
// Map<String, ? extends ServletRegistration> servlets = context.getServletRegistrations();
// if (servlets != null)
// {
// for (ServletRegistration s : servlets.values())
// {
// if (s.getClassName().equalsIgnoreCase(FACES_SERVLET))
// {
// Collection<String> mappings = s.getMappings();
// if (!mappings.isEmpty())
// {
// facesMapping = mappings.iterator().next();
// break;
// }
// }
// }
// }
//
// if (facesMapping == null)
// {
// log.warn("Faces Servlet (javax.faces.webapp.FacesServlet) not found in web context - cannot configure PrettyFaces DynaView");
// }
// }
// else
// {
InputStream in = context.getResourceAsStream(WEB_XML_PATH);
if (in == null)
{
log.warn("No " + WEB_XML_PATH + " found - cannot configure PrettyFaces DynaView");
}

WebXml webXml = new WebXml();
if (in != null)
{
Digester digester = getConfiguredDigester();
digester.push(webXml);
digester.parse(in);
processConfig(webXml);
}
//}

log.trace("Completed parsing web.xml");
}