Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

JSP Smarty

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Hani
Smarty n00b


Joined: 04 Jun 2003
Posts: 4

PostPosted: Tue Jun 10, 2003 6:52 pm    Post subject: JSP Smarty Reply with quote

I was wondering if anyone has ported Smarty to Java to get it to work with JSP files.
Are there any technical obstacles to this.

Hani
Back to top
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jun 10, 2003 10:57 pm    Post subject: Reply with quote

I haven't heard of such a project. For one thing, does JSP have a PHP execution container? It would need one for compatability since templates can include PHP code directly.

Smarty is conceptually tied to PHP -- I THINK that a port would really imply porting the concept as opposed to the actual engine.

On the otherhand, Smarty's parsing is all regex based, so that should be readily portable.

Why bother with Smarty, though, when you have Struts and Jakarta and all those other Java-Centric options??
Back to top
View user's profile Send private message
sweatje
Smarty Regular


Joined: 17 Apr 2003
Posts: 70
Location: Bettendorf, Iowa, USA

PostPosted: Wed Jun 11, 2003 3:46 am    Post subject: Reply with quote

boots wrote:
Why bother with Smarty, though, when you have Struts and Jakarta and all those other Java-Centric options??


Not to be persnickety, but Struts is an MVC framework, and Smarty is more the equivalent of Views in the MVC framework, so the Java world uses JSP pages with Tag Libraries (whatever they are, I only read enough to know the buzzword, never implemented anything Smile )

Syntax compatability (less the {php} ) might be interesting for a shop that wanted to do quick prototypes with PHP, and move more solid apps onto java.
_________________
Jason
jsweat_php AT yahoo DOT com
Back to top
View user's profile Send private message
Hani
Smarty n00b


Joined: 04 Jun 2003
Posts: 4

PostPosted: Wed Jun 11, 2003 3:58 am    Post subject: Reply with quote

JSP templates that I have seen so far are much like many of the other PHP template engines. Smarty does so much more. I particularly like the
way it handles template compilation.

Apart from the PhP tag (which could be replaced by a JSP tag) does any
one know of any technical difficulties that I may encounter (I am not
familiar with the internal workings of Smarty).
** Actually I would just ignore any language specific tags!

Also (as mentioned in the previous post) having multiple flavors of
Smarty gives you more flexibility. While I am at it, does anyone know
anything about ASP and would a similar thing also be possible with it?

Hani
Back to top
View user's profile Send private message Send e-mail
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jun 11, 2003 5:15 am    Post subject: Reply with quote

sweatje wrote:
Not to be persnickety, but Struts is an MVC framework, and Smarty is more the equivalent of Views in the MVC framework


You're right Embarassed! I was thinking of the Velocity template engine (another subproject of Jakarta at project Apache) and again you are right, using Velocity would kind of imply not using JSP Smile -- sorry about that. Then again, I AM asking: why not use Velocity and some existing MVC style framework?

Still, I'm not sure what a compiling template engine would mean in Java. Is it possible to generate .java -> .class files and load them at runtime?

It did get me to think that a JavaScript port of Smarty would be interesting Wink

AFAIK, ASP.net templates already has a builtin compilation system (and it compiles down to byte-code).
Back to top
View user's profile Send private message
sweatje
Smarty Regular


Joined: 17 Apr 2003
Posts: 70
Location: Bettendorf, Iowa, USA

PostPosted: Wed Jun 11, 2003 10:54 am    Post subject: Reply with quote

There was an interesting thread about that over in the Sitepoint forums:
Parsing ASP.NET templates with PHP
_________________
Jason
jsweat_php AT yahoo DOT com
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP