You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by GitBox <gi...@apache.org> on 2022/01/05 12:16:31 UTC

[GitHub] [struts] gregh3269 edited a comment on pull request #523: [WW-5022] Sets escapeHtmlBody to false by default and defines a new flag

gregh3269 edited a comment on pull request #523:
URL: https://github.com/apache/struts/pull/523#issuecomment-1005635772


   For the java templates plugin to work, possibly need to add the escapeHtmlBody parameter to the evaluateExtraParams() of the anchor and submit tag, otherwise its not passed to the plugin.  
   
   org.apache.struts2.components.Anchor
   
   @Override
       protected void evaluateExtraParams() {
           super.evaluateExtraParams();
   
           if (href != null) {
               addParameter("href", ensureAttributeSafelyNotEscaped(findString(href)));
           } else {
               //no href, build it from URL attributes
               StringWriter sw = new StringWriter();
               urlRenderer.beforeRenderUrl(urlProvider);
               urlRenderer.renderUrl(sw, urlProvider);
               String builtHref = sw.toString();
               if (StringUtils.isNotEmpty(builtHref)) {
                   addParameter("href", ensureAttributeSafelyNotEscaped(builtHref));
               }
           }
           **addParameter("escapeHtmlBody", escapeHtmlBody)**;
       }
   
   Maybe there is an alternative way, as escapeHtmlBody is not part of UIBean.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@struts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org