preprocessing JSPs with freemarker and fmpp
aburgel <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
hi,
i'm looking into using freemarker and fmpp to generate jsp pages. it would
basically be using freemarker and fmpp as a sort of preprocessor.
the trouble that i'm running into is the ${foo} syntax is used by both jsp
and freemarker. so in order to get freemarker to generate the correct jsp, i
have to escape it by doing this: ${'$'}{foo}
this makes the template pretty hard to read. so i would like to find some
other solution to this problem. does anyone on this list have any experience
with this problem? what sort of solutions have been found?
i've thought of a couple of things.
1. modify freemarker or jsp engine to accept a different syntax, so, for
example, jsp would use ${} and freemarker would use !{} or whatever so there
is no collision. i think this is the most difficult route because it looks
like ${} is hardcoded into the freemarker parser. i haven't looked tomcat's
jsp parser yet.
2. do some sort of pre-preprocessing. so continue to use the alternative
syntax when writing the template but then convert it to valid freemarker
before sending it to fmpp. this is probably a simple text replacement ${} ->
${'$'}{}, !{} -> ${}. i think modifying fmpp is the best way to do this by
adding some sort of filter to do the text replacement.
is there something in freemarker or fmpp that i'm not seeing that would make
this much easier?
--alex
--
View this message in context: http://www.nabble.com/preprocessing-JSPs-with-freemarker-and-fmpp-tp14670108p14670108.html
Sent from the freemarker-user mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace