velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Updated SilentParseInclude
Date Fri, 14 Apr 2006 18:42:30 GMT
Chris,

Thanks for contributing this.  Do you want to edit the Wiki so this
can be preserved?

WILL

On 4/14/06, Townson, Chris <C.Townson@nature.com> wrote:
> Okay, fixed for me ... Needed to change scope in toolbox and method to templateExists()
>
> In TemplateExistsTool.exists(), change this:
> return this.engine.resourceExists(template);
>
> To this:
> return this.engine.templateExists(template);
>
> And in toolbox.xml, change this:
> <scope>application</scope>
>
> To this:
> <scope>request</scope>
>
> Anyone else encountered similar?
>
> C
>
> > -----Original Message-----
> > From: Townson, Chris [mailto:C.Townson@nature.com]
> > Sent: 14 April 2006 15:01
> > To: velocity-user@jakarta.apache.org
> > Subject: Updated SilentParseInclude
> >
> > Hi,
> >
> > I just noticed Shinobu's updated version of the Fred Toth's
> > TemplateExistsTool for the VelocityViewServlet in Velocity
> > Tools v.1.2 (details on wiki here:
> > http://wiki.apache.org/jakarta-velocity/SilentParseInclude)
> >
> > This updated class doesn't seem to work for me (using tools
> > 1.2 and velocity 1.4 ... i.e. current release versions, not dev tree)
> >
> > The problem originates with the new exists(String template)
> > method: this uses the resourceExists() method which exists
> > for org.apache.velocity.app.Velocity (in favour of the
> > deprecated templateExists()), but not for
> > org.apache.velocityapp.VelocityEngine (which only has the
> > templateExists() method ... Not deprecated). I am therefore
> > getting a java.lang.Error because the resourceExists() is
> > undefined for VelocityEngine.
> >
> > Changing resourceExists() to templateExists() results in
> > NullPointerException.
> >
> > Can anyone tell me what is going on here?
> >
> > Cheers,
> >
> > Chris
> >
> > **************************************************************
> > ******************
> > 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
> > **************************************************************
> > ******************
> >
>
> ********************************************************************************
> 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
> ********************************************************************************
>


--
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message