0

I've mapped a static content handler on my Undertow subsystem. However, my app will be deployed independently on different servers, and as such, the physical paths that will be used for static content may differ. Is there a way to obtain programatically (on runtime) any Undertow property, to obtain the path? Basically, I have this:

<subsystem xmlns="urn:jboss:domain:undertow:3.0">
    <buffer-cache name="default"/>
    <server name="default-server">
        <http-listener name="default" redirect-socket="https" socket-binding="http"/>
        <host name="default-host" alias="localhost">
            <location name="/" handler="welcome-content"/>
            <location name="/static" handler="MyStaticHandler"/>
            <filter-ref name="server-header"/>
            <filter-ref name="x-powered-by-header"/>
        </host>
    </server>
    <servlet-container name="default">
        <jsp-config/>
        <websockets/>
    </servlet-container>
    <handlers>
        <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
        <file name="MyStaticHandler" follow-symlink="true" directory-listing="true" cache-buffers="1024" cache-buffer-size="1024" path="/var/wildfly/static"/>
    </handlers>
    <filters>
        <response-header name="server-header" header-value="WildFly/10" header-name="Server"/>
        <response-header name="x-powered-by-header" header-value="Undertow/1" header-name="X-Powered-By"/>
    </filters>
</subsystem>

I want to be able to get "/var/wildfly/static" on runtime. Is this doable?

rion18
  • 1,211
  • 16
  • 22
  • Perhaps the second answer of http://stackoverflow.com/questions/22684037/how-to-configure-wildfly-to-serve-static-content-like-images?rq=1 serves your problem. – Smutje Mar 31 '16 at 21:25
  • @Smutje I've already seen that. I was actually wondering if I could get that property via Undertow... – rion18 Mar 31 '16 at 21:29
  • Guess I'll just stick to OmniFaces' FileServlet... http://showcase.omnifaces.org/servlets/FileServlet – rion18 Mar 31 '16 at 21:40

0 Answers0