Typed Text Templates with Stripes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Typed Text Templates with Stripes

VANKEISBELCK Remi
Hi folks,

I have managed to wrap up a 0.1-beta release for those who want to try out TTT templates with Stripes.

The whole TTT fwk (compiler, build tools, IDE plugin) is there :

The Stripes integration is here :

For the impatient, here's a TTT-style Calculator template, adapted from the Stripes Examples.

I don't have much of the JSP tags ported yet (basically only s:form and s:link), but it's easier than I thought. I hope to continue with this and cover the whole features soon.

Tell me what you think.

Cheers

Rémi



------------------------------------------------------------------------------

_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

Re: [Stripes-users] Typed Text Templates with Stripes

VANKEISBELCK Remi
Hi Nestor,

I don't know razor, but it doesn't seem to have the signature as first class citizen, like TTT does.

new MyTemplate( myFoo, myBar ).render( out );

It's a huge difference. With TTT, if you change the signature of a template, then the ActionBean(s) using it will not compile. Compare this to using a jsp:forward, which ain't typesafe at all...

As for JSP/Scriptlets, I'm trying to stick to JSP subset just because this way I can reuse JSP IDE tooling. 

It's really cool to see the completion, error reporting etc at work without actually coding anything, just associating .ttt files to JSP editor in IDEA...

So I've managed to use only parts of the JSP syntax for my own needs. For example, I use the "JSP declaration" (first code-like block in template, the between <%! and %>) in order to declare the template's signature. So this template :

<%!
  String foo;
%> 

has 1 arg 'foo' of type String. It compiles to an immutable class with one constructor that accepts all defined arguments, and has a render() method :

new MyTemplate( "hey there" ).render( out );

Cheers

Rémi



2015-08-06 2:17 GMT+02:00 Nestor Hernandez <[hidden email]>:

Hey Remi. Looks good. Seems to try to emulate ASP. NET razor template. But, seems like you're intentionally breaking rules about the use of scriptlets.

El 5/8/2015 19:00, "VANKEISBELCK Remi" <[hidden email]> escribió:
Hi folks,

I have managed to wrap up a 0.1-beta release for those who want to try out TTT templates with Stripes.

The whole TTT fwk (compiler, build tools, IDE plugin) is there :

The Stripes integration is here :

For the impatient, here's a TTT-style Calculator template, adapted from the Stripes Examples.

I don't have much of the JSP tags ported yet (basically only s:form and s:link), but it's easier than I thought. I hope to continue with this and cover the whole features soon.

Tell me what you think.

Cheers

Rémi



------------------------------------------------------------------------------

_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------

_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development