thanks for checking this out, guys - I've created a jira issue with the example.

see https://issues.apache.org/jira/browse/VELOCITY-537

Cheers,

Chris

> -----Original Message-----
> From: Will Glass-Husain [mailto:[EMAIL PROTECTED] 
> Sent: 03 April 2007 17:40
> To: Velocity Users List
> Subject: Re: macros and comments between 1.4 and 1.5
> 
> Was it an API compatibility issue?
> 
> We converted a lot of the exception logging to passing them on for
> 1.5.  I remember some of them we couldn't due to API's that didn't
> list the exceptions.  Once we converted the exceptions to be
> unchecked, we could do this.  (maybe we missed one).
> 
> I'm thinking we should address this item, Matt Raible's bug, add any
> additional "known issues" to the readme and release 1.5.1.  Perhaps we
> should target May 1 to allow any additional issues to arise.
> 
> WILL
> 
> On 4/3/07, Nathan Bubna <[EMAIL PROTECTED]> wrote:
> > just to confirm, i get the same error for that macro, and i 
> don't see
> > anything wrong with it.
> >
> > i'm also surprised that the template i put the macro in still works,
> > with the parse exception only showing up in the logs.  
> anyone know why
> > VelocimacroManager.MacroEntry.parseTree() only logs parse 
> exceptions,
> > rather than letting them go or throwing a new exception that wraps
> > them?
> >
> > On 4/3/07, Townson, Chris <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > Moving from velocity engine 1.4 to 1.5, one of my macros 
> is now causing a ParseException:
> > >
> > > #macro( makeLink $filepath )#*
> > >
> > >     *##if 
> ($request.serverName.equalsIgnoreCase("www.liveserver.com") 
> || $request.serverName.equalsIgnoreCase("liveserver.com"))#*
> > >
> > >         *##set($mirrorDomain = "livemirror.com")#*
> > >
> > >     
> *##elseif($request.serverName.equalsIgnoreCase("stagingserver.com"))#*
> > >
> > >         *##set($mirrorDomain = "stagingmirror.com")#*
> > >
> > >     
> *##elseif($request.serverName.equalsIgnoreCase("devserver.com"
> ) || $request.serverName.equalsIgnoreCase("localhost"))#*
> > >
> > >         *##set($mirrorDomain = "devmirror.com")#*
> > >
> > >     *##else#*
> > >
> > >         *##set($mirrorDomain = "liveserver.com")#*
> > >
> > >     *##end#*
> > >
> > >     *#http://${mirrorDomain}${filepath}#*
> > >
> > > *##end
> > >
> > >
> > > This macro uses the mutli-line comment hack to gobble 
> whitespace (so that none appears in the link text, whilst 
> preserving some kind of readability.
> > >
> > > This works fine in 1.4, but throws a ParseException in 
> 1.5 (stacktrace below)
> > >
> > > Is this known or expected beahviour? (I had a browse 
> through jira and the wiki, but couldn't see anything which 
> would seem to identify this problem).
> > >
> > > Thanks,
> > >
> > > Chris
> > >
> > > -- stacktrace --
> > >
> > > 2007-04-03 16:05:38,712 - VelocimacroManager.parseTree() 
> : exception makeLink
> > > org.apache.velocity.runtime.parser.ParseException: 
> Lexical error: 
> org.apache.velocity.runtime.parser.TokenMgrError: Lexical 
> error at line 1, column 535.  Encountered: <EOF> after : ""
> > >         at 
> org.apache.velocity.runtime.parser.Parser.parse(Parser.java:124)
> > >         at 
> org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInsta
> nce.java:1042)
> > >         at 
> org.apache.velocity.runtime.directive.VelocimacroProxy.parseTr
> ee(VelocimacroProxy.java:342)
> > >         at 
> org.apache.velocity.runtime.directive.VelocimacroProxy.setupMa
> cro(VelocimacroProxy.java:322)
> > >         at 
> org.apache.velocity.runtime.directive.VelocimacroProxy.init(Ve
> locimacroProxy.java:309)
> > >         at 
> org.apache.velocity.runtime.parser.node.ASTDirective.init(ASTD
> irective.java:134)
> > >         at 
> org.apache.velocity.runtime.parser.node.SimpleNode.init(Simple
> Node.java:285)
> > >         at 
> org.apache.velocity.Template.initDocument(Template.java:199)
> > >         at org.apache.velocity.Template.process(Template.java:121)
> > >         at 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadR
> esource(ResourceManagerImpl.java:415)
> > >         at 
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getRe
> source(ResourceManagerImpl.java:335)
> > >         at 
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(Runtim
> eInstance.java:1102)
> > >         at 
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(Runtim
> eInstance.java:1077)
> > >         at 
> org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEng
> ine.java:528)
> > >         at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.get
> Template(VelocityViewServlet.java:667)
> > >         at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.han
> dleRequest(VelocityViewServlet.java:601)
> > >         at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.doR
> equest(VelocityViewServlet.java:541)
> > >         at 
> org.apache.velocity.tools.view.servlet.VelocityViewServlet.doG
> et(VelocityViewServlet.java:507)
> > >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
> > >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > >         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(ApplicationFilterChain.java:252)
> > >         at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterChain.java:173)
> > >         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.java:213)
> > >         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.java:178)
> > >         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:126)
> > >         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:105)
> > >         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java:107)
> > >         at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap
> ter.java:148)
> > >         at 
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:869)
> > >         at 
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHa
ndler.processConnection(Http11BaseProtocol.java:664)
> > >         at 
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolT
> cpEndpoint.java:527)
> > >         at 
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(Le
> aderFollowerWorkerThread.java:80)
> > >         at 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
> > >         at java.lang.Thread.run(Thread.java:595)
> > >
> > > 
> **************************************************************
> ******************
> > > DISCLAIMER: This e-mail is confidential and should not be 
> used by anyone who is
> > > not the original intended recipient. If you have received 
> this e-mail in error
> > > please inform the sender and delete it from your mailbox 
> or any other storage
> > > mechanism. Neither Macmillan Publishers Limited nor any 
> of its agents accept
> > > liability for any statements made which are clearly the 
> sender's own and not
> > > expressly made on behalf of Macmillan Publishers Limited 
> or one of its agents.
> > > Please note that neither Macmillan Publishers Limited nor 
> any of its agents
> > > accept any responsibility for viruses that may be 
> contained in this e-mail or
> > > its attachments and it is your responsibility to scan the 
> e-mail and
> > > attachments (if any). No contracts may be concluded on 
> behalf of Macmillan
> > > Publishers Limited or its agents by means of e-mail 
> communication. Macmillan
> > > Publishers Limited Registered in England and Wales with 
> registered number 785998
> > > Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS
> > > 
> **************************************************************
> ******************
> > >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> Forio Business Simulations
> 
> Will Glass-Husain
> [EMAIL PROTECTED]
> www.forio.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

********************************************************************************
   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 
785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to