struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
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/ decorations can
be handled by sitemesh
    <bean class="org.apache.struts2.sitemesh.FreeMarkerPageFilter" static="true" optional="true"/>
    <bean class="org.apache.struts2.sitemesh.VelocityPageFilter" static="true" optional="true"/>

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

MG>VPageFilter would insert attrs into velocity Context then render
            // finally, render it
            PrintWriter writer = res.getWriter();
            template.merge(context, writer);

MG>in the end JS coder can inject canned/customised decorator JS into their function with
'@' sign

JavaScript Decorators: What They Are and When to Use Them<>
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 ...

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

MG​>Future considerations:
MG>when ECMAScript gurus incorporate transpiler support for Decorator JS Code into ECMAscript
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message