Skip to content

Commit 7691926

Browse files
committed
Workaround for (WebLogic bug) deployment problem: http://ocpsoft.org/support/topic/weblogic-prettyfaces-deployment-problem
1 parent d3737ea commit 7691926

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎core/src/main/java/com/ocpsoft/pretty/faces/config/servlet/WebXmlParser.java‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ public class WebXmlParser
4444

4545
private static final String FACES_SERVLET = "javax.faces.webapp.FacesServlet";
4646
private static final String WEB_XML_PATH = "/WEB-INF/web.xml";
47+
public static final String CONFIG_FORCE_PARSING = "com.ocpsoft.pretty.DISABLE_SERVLET_3.0_SUPPORT";
4748

4849
String facesMapping = null;
4950

5051
public void parse(final ServletContext context) throws IOException, SAXException
5152
{
52-
if (context.getMajorVersion() >= 3)
53+
if (context.getMajorVersion() >= 3 && !forceParsing(context))
5354
{
5455
Map<String, ? extends ServletRegistration> servlets = context.getServletRegistrations();
5556
if (servlets != null)
@@ -94,6 +95,17 @@ public void parse(final ServletContext context) throws IOException, SAXException
9495
log.trace("Completed parsing web.xml");
9596
}
9697

98+
private boolean forceParsing(ServletContext context)
99+
{
100+
String forceParsing = context.getInitParameter(CONFIG_FORCE_PARSING);
101+
if ((forceParsing != null) && forceParsing.trim().equalsIgnoreCase("true"))
102+
{
103+
log.debug("Servlet 3.0 API has been disabled! PrettyFaces will parse web.xml manually.");
104+
return true;
105+
}
106+
return false;
107+
}
108+
97109
private void processConfig(final WebXml webXml)
98110
{
99111
ServletDefinition facesServlet = null;

0 commit comments

Comments
 (0)