Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39853 > unrolled thread
| Started by | "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> |
|---|---|
| First post | 2022-11-21 09:50 -0800 |
| Last post | 2022-11-21 11:10 -0800 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.java.programmer
struts2 syntax "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-21 09:50 -0800
Re: struts2 syntax Arne Vajhøj <arne@vajhoej.dk> - 2022-11-21 14:00 -0500
Re: struts2 syntax "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-21 11:10 -0800
| From | "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> |
|---|---|
| Date | 2022-11-21 09:50 -0800 |
| Subject | struts2 syntax |
| Message-ID | <4b8ec277-7e99-45ce-84a5-f7664811d6b8n@googlegroups.com> |
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}"/>
[toc] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2022-11-21 14:00 -0500 |
| Message-ID | <tlghrt$10s9$1@gioia.aioe.org> |
| In reply to | #39853 |
On 11/21/2022 12:50 PM, e.d.pro...@gmail.com wrote:
> 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}"/>
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
[toc] | [prev] | [next] | [standalone]
| From | "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> |
|---|---|
| Date | 2022-11-21 11:10 -0800 |
| Message-ID | <1ac68866-8e0f-4e5e-8da4-4e15dd7ac5c5n@googlegroups.com> |
| In reply to | #39854 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web