This content has been marked as final.
Show 3 replies
-
1. Re: Where to store static contents like images on Wildfly 8.2.0
jboss234 May 22, 2015 1:44 PM (in response to jboss234)Any suggestions ?
-
2. Re: Where to store static contents like images on Wildfly 8.2.0
jaysensharma May 24, 2015 12:13 AM (in response to jboss234)1 of 1 people found this helpfulHello DP,
You can try the following, Add a new Handler inside the "undertow" subsystem and then add that handler reference to the "Host" tag present in the same undertow subsystem:
<subsystem xmlns="urn:jboss:domain:undertow:1.2"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <location name="/images" handler="PicturesDir"/> <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="PicturesDir" path="/PATH/TO/Pictures" directory-listing="true"/> </handlers> <filters> <response-header name="server-header" header-name="Server" header-value="WildFly/8"/> <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/> </filters> </subsystem>
Notice the following lines which are added to the default configuration of the undertow::
<file name="PicturesDir" path="/PATH/TO/Pictures" directory-listing="true"/> AND <location name="/images" handler="PicturesDir"/>
Restart Wildfly and then access the URL:
-
3. Re: Where to store static contents like images on Wildfly 8.2.0
jboss234 Jun 9, 2015 4:44 PM (in response to jaysensharma)Thanks Jay Kumar, It's working with above steps.
Thanks,
Dhaval