posted 14 years ago
Hi,
I am in the process of changing all the paths in js files to prepend the context root to the paths.
I can get context path in the js by way of reading application.xml but that puts a restriction of not being able to read the application.xml from a relative path. Because application.xml is placed in META-INF which is not accessible to the outside world.
2nd way is i can include a header jsp in all the jsps and then have a common code like
<script type="text/javascript">
var CONTEXT_ROOT = '<%= request.getContextPath() %>';
</script>
now we could refer to context_root in all the js files.
is there any other alternative too?
thanks
sandeepraj