Re: Simple Velocity question
Florin PATRASCU <[email protected]> Mon, 27 Sep 2004 15:57:50 -0400
| Newsgroups | gmane.comp.java.jpublish.devel |
|---|---|
| Message-ID | <6.1.1.1.2.20040927140750.0217e2c8@pop.bloor.is.net.cable.rogers.com> |
Hi Thomas, Unfortunately you need to use a Velocity nightly build http://www.mail-archive.com/[email protected]/msg12537.html or to write a simple Action (js, bsh, python or pure Java) to add a Map to= =20 your page action, something like: Map myMap =3D new HashMap(); ... myMap.put("keyA", "value A"); ... context.put("myMap", myMap); ... And then use it in your html page: .... A simple value from my map: $myMap.get("keyA")<br> ... and so on. I am sorry there is no a direct fix yet to the problem you mentioned. But=20 reading the mail thread I posted above, this will be soon fixed by the=20 Velocity team. Sincerely, -Florin http://weblog.flop.ca At 26/09/2004 16:37, Thomas K=F6llmann wrote: >Hi! > >I'm trying to build a navigation menu for my little JPublish (2.0.2) >playground using a Velocity foreach loop. For that I need pairs of a >'link' and its 'title'. (I'm quite clueless being not a programmer, but >I guess this is pretty standard.) > >So I took this straight from the Velocity user guide >(http://jakarta.apache.org/velocity/user-guide.html#Set): > >#set( $monkey.Map =3D {"banana" : "good", "roast beef" : "bad"}) > >But...: > >org.jpublish.TemplateMergeException: Lexical error: >org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line >69, column 21. Encountered: "{" (123), after : "" > >I've tried all kinds of variations and typings, but to no avail. What's >wrong here? > >I'm sorry if you feel this is a Velocity question I should ask >elsewhere. > >Thanks a lot, > - Thomas > > >PS: The JPublish site is down for weeks, it seems to me. Is everything >ok? > > >-- ># PGP key auf Wunsch per e-mail / PGP key sent on request > > >------------------------------------------------------- >This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 >Project Admins to receive an Apple iPod Mini FREE for your judgement on >who ports your project to Linux PPC the best. Sponsored by IBM. >Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php >_______________________________________________ >Jpublish-developer mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/jpublish-developer ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php