struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject Re: Would we need to achieve better place in trends ranking?
Date Tue, 11 Dec 2018 13:03:47 GMT

>
>
> 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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message