|
2 macros with the same name allowed?: msg#00221jakarta.velocity.user
Hi all, I have a really long macro called displayAllMessages which is used to display nicely formatted messages to the user of my web application. The macro takes two arguments; the messages to display and the color to display them... #macro (displayAllMessages $data $color) <snip> #end I want to make the default color red, so I have created another macro that calls the long macro... #macro (displayAllMessages $data) #displayAllMessages($data, "red") #end However, when I call the macro from one of my templates like so... #displayAllMessages($data, "black") ... I get the attached error messages from Velocity. Am I allowed to have two macros with the same name call each other in Velocity? BTW, I'm using Velocity 1.2. Regards, -- Rodney ---------------------------------------------------- Wed Nov 27 18:05:10 GMT+11:00 2002 [error] Parser Exception: screens/Upload.vm : org.apache.velocity.runtime.parser.ParseException: Encountered "," at line 84, column 34. Was expecting one of: "[" ... <RPAREN> ... <WHITESPACE> ... <STRING_LITERAL> ... "true" ... "false" ... <NUMBER_LITERAL> ... <WORD> ... <IDENTIFIER> ... "{" ... "}" ... <DOT> ... Wed Nov 27 18:05:10 GMT+11:00 2002 [error] ResourceManager.getResource() parse exception: org.apache.velocity.exception.ParseErrorException: Encountered "," at line 84, column 34. Was expecting one of: "[" ... <RPAREN> ... <WHITESPACE> ... <STRING_LITERAL> ... "true" ... "false" ... <NUMBER_LITERAL> ... <WORD> ... <IDENTIFIER> ... "{" ... "}" ... <DOT> ... Wed Nov 27 18:05:10 GMT+11:00 2002 [error] VM #displayAllMessages: error : too few arguments to macro. Wanted 2 got 1 --> org.apache.velocity.runtime.resource.loader.FileResourceLoader Wed Nov 27 18:05:10 GMT+11:00 2002 [error] VM error : displayAllMessages. Null AST ---------------------------------------------------- |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re[2]: Newbie - Keep getting ResourceNotFoundException: 00221, Geir Magnusson Jr . |
|---|---|
| Next by Date: | Re: Newbie - Keep getting ResourceNotFoundException: 00221, Antonie C Malan |
| Previous by Thread: | Contexts and Profilingi: 00221, Michal Chmielewski |
| Next by Thread: | Re: 2 macros with the same name allowed?: 00221, Geir Magnusson Jr . |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |