I don't know Struts 2 (I did a bit of Struts 1 a very long time ago,
but Struts 2 is not based on Struts 1 but on WebWorks).
Anyway, what is the problem you need to solve. Aka why not just:
<script src="/js/myScript.js"></script>
?
Do you need it to insert the web app name so it becomes:
<script src="/foobar/js/myScript.js"></script>
automatically if it is deployed in foobar.war?
Arne
Anyone know this framework? I can't find any documentation or examples.
We were including javascript in JSP like this, which was generating a CSP security error:
<script src="<s:url value="/js/myScript.js"/>"></script>
I tried just changing it to the struts tag and it just crashed:
<s:script src="<s:url value="/js/myScript.js"/>"></s:script>
So I'm trying to figure out if this can be done as a one line command, as it does work as a two line command:
<s:url var="myScriptjs" value='/js/myScript.js' encode='false' includeParams='none'/>
<s:script src="%{myScriptjs}"/>
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 184:06:59 |
Calls: | 9,705 |
Files: | 13,737 |
Messages: | 6,179,583 |