struts-community-plugins / struts2-jquery

Struts2 jQuery Plugin
Apache License 2.0
83 stars 49 forks source link

Includes nonce attribute in <script> tags #318

Closed lukaszlenart closed 1 year ago

lukaszlenart commented 1 year ago

Closes #142 Depends on https://github.com/apache/struts/pull/629

lukaszlenart commented 1 year ago

I must use <s:script/> tag to have nonce

TheFergus commented 1 year ago

@lukaszlenart Hi, for <s:/script>, if the src of the tags needs variables, what should I do? <s:script src="${myUrl}"></s:script>

lukaszlenart commented 1 year ago

@lukaszlenart Hi, for <s:/script>, if the src of the tags needs variables, what should I do? <s:script src="${myUrl}"></s:script>

The simplest way is to use <s:url/>

<s:url var="js" value="js/html5.js"/>
<s:script src="%{js}"/>
lukaszlenart commented 1 year ago

@jogep or @sdutry could you review/approve this PR? It would be good to release a new version of the JQuery plugin as this will allow to fix an issue in the Bootstrap plugin as well.

jogep commented 1 year ago

@lukaszlenart just spended a minute to test if we are ready to release. But the grid showcase failed to load and it needs some investigations.

Caused by: freemarker.core.ParseException: Syntax error in template "template/jquery/grid-close.ftl" in line 355, column 1: Encountered "</@s.script>", but was expecting one of:

lukaszlenart commented 1 year ago

Ok, I will fix that