struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Husted" <hus...@apache.org>
Subject Re: [s2] Google XML Pages (GXP) to replace Freemarker in tags?
Date Sun, 27 Jul 2008 09:18:06 GMT
Yes, for anyone unfamilar with how the "Struts Tags" are implemented,
the content of all three flavors of tags -- JSP, Velocity, and
Freemarker -- are, way down deep, generated from the same set of
templates. The content generated by the template is then wrapped as a
JSP tag, Velocity macro, or Freemarker tag. For example, here's the
gritty guts of our "a" tag:

<a<#rt/>
<#if parameters.id?if_exists != "">
 id="${parameters.id?html}"<#rt/>
</#if>
<#if parameters.href?if_exists != "">
 href="${parameters.href}"<#rt/>
</#if>
<#if parameters.tabindex?exists>
 tabindex="${parameters.tabindex?html}"<#rt/>
</#if>
<#if parameters.cssClass?exists>
 class="${parameters.cssClass?html}"<#rt/>
</#if>
<#if parameters.cssStyle?exists>
 style="${parameters.cssStyle?html}"<#rt/>
</#if>
<#if parameters.title?exists>
 title="${parameters.title?html}"<#rt/>
</#if>
<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
<#include "/${parameters.templateDir}/simple/dynamic-attributes.ftl" />
>

* http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/simple/a.ftl?revision=590812&view=markup

Note that the block starts with "<a" and ends with ">". Everything
else in the block generates dynamic content that might go between "<a"
and ">".

The proposal would use GXP to generate the same content as we do here,
so we can wrap the output as a JSP, Velocity, or Freemarker "tag".

HTH, Ted.
http://husted.com/ted/blog/

On Sat, Jul 26, 2008 at 3:39 PM, Dave Newton <newton.dave@yahoo.com> wrote:
> --- On Sat, 7/26/08, Piero Sartini <lists@pierosartini.de> wrote:
>> Since there is no support for JSP tags in GXP, how could
>> the struts2 tags be accessed in such an result?
>
> Er, I think the idea was to use GXP instead of FreeMarker for the S2 tags.
>
> Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message