java - How to make a local JBOSS AS 7 serve static resources? -
as standard, static resources need stay in centralized location, out of ears / wars (so can updated without rolling out new release minor js/css changes).
my html imports relative, eg:
<script type="text/javascript" src="/resources/myapp/js/bootstrap.min.js"></script>
this means urls resources different on every server (development, test, production..):
on dev-foobar.com
:
dev-foobar.com/resources/myapp/js/bootstrap.min.js
on tst-foobar.com
:
tst-foobar.com/resources/myapp/js/bootstrap.min.js
on foobar.com
:
foobar.com/resources/myapp/js/bootstrap.min.js
but when i'm on local jboss (localhost:8080
), how can instruct serve same static resources achieve following url ?
localhost:8080/resources/myapp/js/bootstrap.min.js
jboss handles static resources through folder called welcome-content
under $jboss_home
:
c:\program files\eap-6.2.0\jboss-eap-6.2\welcome-content
simply put there, , exposed in root context.
for example, it's sufficient copy sample folders , file described in question:
c:\program files\eap-6.2.0\jboss-eap-6.2\welcome-content\resources\myapp\js\bootstrap.min.js
to end file (but not folders) being accessible through url:
localhost:8080/resources/myapp/js/bootstrap.min.js
well done, red hat !
Comments
Post a Comment