On Monday, November 21, 2022 at 2:00:29 PM UTC-5, Arne Vajhøj wrote:
> 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
I'm new to this struts project myself, my previous project just used spring framework, so the s:url part was already there I'm assuming needs to be there.
Seems likely this relative path url will end up inserting the war name.
I haven't found much for documentation on these struts tags, mostly figuring out through trial and error. I could try the direct path without the s:url and see what it does.
It could respond differently in eclipse embedded tomcat versus building a war and running it outside of eclipse, assuming that war will run the same on my tomcat or another machine.
In the Spring project I was on I did write some JSP links using JSTL url tag, seems like this should be the same thing.
https://www.w3schools.blog/jstl-curl-core-tag