-
1. Re: Using HttpHandler class in Undertow
jaikiran Jun 22, 2016 2:56 AM (in response to geturner)I think you might get this answered in the undertow-dev list which is frequented by undertow developers, if you ask there undertow-dev Info Page
-
2. Re: Using HttpHandler class in Undertow
ctomc Jun 22, 2016 5:54 AM (in response to geturner)To modify the handler chain of your deployment take you should write ServletExtension http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#servlet-extensions
but for more in depth questions on how to implement specific handlers, I would agree with Jaikiran and point you do undertow-dev mailing list.
-
3. Re: Using HttpHandler class in Undertow
geturner Jun 22, 2016 8:36 AM (in response to ctomc)I don't want a per app solution, I need a per server zolution. I did find an example of using the handler to setup a filter. I am chasing that, I will post my solution if it works.
-
4. Re: Using HttpHandler class in Undertow
ctomc Jun 22, 2016 9:18 AM (in response to geturner)then you need to package your handler(s) into a module, and configure custom-filter in undertow subsystem.
-
5. Re: Using HttpHandler class in Undertow
geturner Jun 22, 2016 9:21 AM (in response to ctomc)Exactly what I am doing. I found what looks like a very good example:
https://kb.novaordis.com/index.php/Configuring_a_Custom_Undertow_Filter_in_WildFly
-
6. Re: Using HttpHandler class in Undertow
geturner Jun 24, 2016 8:16 AM (in response to geturner)I am posting my own solution for others to use. Here is the implementation of the filter class, with the standalone excerpt and the module definition, enjoy!
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" max-post-size="9223372036854775807" socket-binding="http" redirect-socket="https"/>
<https-listener name="default-https" max-post-size="9223372036854775807"
enabled-protocols="TLSv1,TLSv1.1,TLSv1.2" verify-client="REQUIRED" security-realm="ApplicationRealm" socket-binding="https"/><host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/downloads" handler="download_handler"/>
<access-log pattern="%h %l %u [%t] "%r" %s %b "%{i,Referer}" "%{i,User-Agent}""/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
<filter-ref name="certificaterevocationfilter"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
<file name="download_handler" directory-listing="true" path="/downloads"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<filter name="certificaterevocationfilter" module="com.lmco.spacefence.server"
class-name="com.lmco.spacefence.server.certificaterevocation.CertificateRevocationFilter"/></filters>
-
module.xml.zip 322 bytes
-