>
>
> MG> remembering days of barosso-wannamacher regime the JS library du-jour
> >was 'sitemesh' has struts2 deprecated support for sitemesh?
>

SiteMesh had nothing to do with JS.

MG>more of an alert to JS programmers that for title/body/page.properties 
decorations can be handled by sitemesh
MG>struts-plugin
MG><struts>
    <bean class="org.apache.struts2.sitemesh.FreeMarkerPageFilter" 
static="true" optional="true"/>
    <bean class="org.apache.struts2.sitemesh.VelocityPageFilter" static="true" 
optional="true"/>
</struts>

MG>FMPageFilter would process page title and body by inserting attrs into 
SimpleHash model
         model.put("title",page.getTitle());
            model.put("body",page.getBody());
            model.put("page.properties", new SimpleHash(page.getProperties()));
            // finally, render it
            template.process(model, res.getWriter());

MG>VPageFilter would insert attrs into velocity Context then render
       context.put("title",page.getTitle());
            context.put("body",page.getBody());
            // finally, render it
            PrintWriter writer = res.getWriter();
            template.merge(context, writer);
            writer.flush();

MG>in the end JS coder can inject canned/customised decorator JS into their 
function with '@' sign
https://www.sitepoint.com/javascript-decorators-what-they-are/
[https://www.sitepoint.com/wp-content/themes/sitepoint/assets/images/icon.javascript.png]<https://www.sitepoint.com/javascript-decorators-what-they-are/>

JavaScript Decorators: What They Are and When to Use 
Them<https://www.sitepoint.com/javascript-decorators-what-they-are/>
In its simplest form, a decorator is simply a way of wrapping one piece of code 
with another — literally “decorating” it. This is a concept you might well have 
heard of previously as ...
www.sitepoint.com

MG>the JS coder would say I need transpiler support on my browser for 
decorating JS functions is not yet supported

MG>in that case import sitemesh-plugin from struts-2.1.6 and use fm or vm 
macros for site decoration

MG​>Future considerations:
MG>when ECMAScript gurus incorporate transpiler support for Decorator JS Code 
into ECMAscript standard
MG>and chrome,edge,safari,opera and firefox support ECMA standard that has 
transpiler support
MG>organisations that supported their-own HTML decorations (Spring/Struts)
MG> can safely deprecate their own decorators and implement JS decorations

Reply via email to