394870 Make enablement of remote access to test webapp configurable in override-web.xml
This commit is contained in:
parent
5f69945b33
commit
fc2682ab02
|
@ -38,6 +38,22 @@
|
||||||
<load-on-startup>5</load-on-startup>
|
<load-on-startup>5</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<!-- Uncomment to override the setup of the test filter -->
|
||||||
|
<!--
|
||||||
|
<filter>
|
||||||
|
<filter-name>TestFilter</filter-name>
|
||||||
|
<filter-class>com.acme.TestFilter</filter-class>
|
||||||
|
<async-support>true</async-support>
|
||||||
|
<init-param>
|
||||||
|
<param-name>remote</param-name>
|
||||||
|
<param-value>false</param-value>
|
||||||
|
</init-param>
|
||||||
|
</filter>
|
||||||
|
<filter-mapping>
|
||||||
|
<filter-name>TestFilter</filter-name>
|
||||||
|
<url-pattern>/*</url-pattern>
|
||||||
|
</filter-mapping>
|
||||||
|
-->
|
||||||
</web-app>
|
</web-app>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -127,12 +127,15 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeL
|
||||||
|
|
||||||
/* For servlet 3.0 */
|
/* For servlet 3.0 */
|
||||||
FilterRegistration.Dynamic registration = sce.getServletContext().addFilter("TestFilter",TestFilter.class.getName());
|
FilterRegistration.Dynamic registration = sce.getServletContext().addFilter("TestFilter",TestFilter.class.getName());
|
||||||
registration.setInitParameter("remote", "false");
|
if (registration != null) //otherwise defined in web.xml
|
||||||
registration.setAsyncSupported(true);
|
{
|
||||||
registration.addMappingForUrlPatterns(
|
registration.setInitParameter("remote", "false");
|
||||||
EnumSet.of(DispatcherType.ERROR,DispatcherType.ASYNC,DispatcherType.FORWARD,DispatcherType.INCLUDE,DispatcherType.REQUEST),
|
registration.setAsyncSupported(true);
|
||||||
true,
|
registration.addMappingForUrlPatterns(
|
||||||
new String[]{"/*"});
|
EnumSet.of(DispatcherType.ERROR,DispatcherType.ASYNC,DispatcherType.FORWARD,DispatcherType.INCLUDE,DispatcherType.REQUEST),
|
||||||
|
true,
|
||||||
|
new String[]{"/*"});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,12 +21,11 @@ cross domain scripting vulnerabilities and reveal private information. This pag
|
||||||
is displayed because you have accessed this context from a non local IP address.
|
is displayed because you have accessed this context from a non local IP address.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You can disable the remote address checking by editing webapps/test.d/override-web.xml and changing the
|
You can disable the remote address checking by editing webapps/test.d/override-web.xml, uncommenting the declaration of the TestFilter, and changing the
|
||||||
"remote" init parameter to true for the TestFilter.
|
"remote" init parameter to "true".
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
This webapp is deployed in $JETTY_HOME/webapps/test and configured by $JETTY_HOME/webapps/test.xml
|
This webapp is deployed in $JETTY_HOME/webapps/test and configured by $JETTY_HOME/webapps/test.xml and $JETTY_HOME/webapps/test.d/override-web.xml
|
||||||
and $JETTY_HOME/webapps/test.d/override-web.xml
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
|
|
Loading…
Reference in New Issue