velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Can I write a macro that can call itself?
Date Sat, 14 Jul 2001 01:31:00 GMT
Brad Cox wrote:
> 
> At 3:21 PM -0700 7/13/01, Jon Stevens wrote:
> >  > Yes, but not extensive. In a shop that was committed to an inhouse
> >  > template language and not inclined to change.
> >
> >So, you question the use and implementation of Velocity even though you
> >haven't used it yourself? Hmmmmm...
> 
> Offering a technique for improving something is not the same as
> questioning its use and implementation. The website describes the
> advantages of taking a compile-time approach without criticizing any
> particular alternative. The only exception I can think of is allowing
> NullPointerExceptions by not doing semantic checks on values read
> from properties file, which was aimed at every jakarta project I've
> ever used, not just Velocity.

Be honest here :

1) In the post to this list, you specifically criticized Velocity, which
is ok.  What I found not ok was that I read it as a strawman - you
weren't saying "Hey, I have an issue with your configuration, and here's
why...", but rather presented almost as a platform to pitch JAWA.  Just
pitch JAWA if you want.  I think they are two separate subjects.

2)  You are right re the NPE's and they will be taken care of.  I
promise.  However, since I am still working on becoming psychic, when
this kind of stuff is found, it has to be reported to the community via
the list or Bugzilla (ugh...).

> 
> >  > Why shouldn't exceptions report the problem exactly? It costs nothing
> >>  to be explicit: e.g. "Couldn't find filename.xt in any of [ dir1,
> >>  dir2, dir3 ]". As it now stands, its like a C compiler complaining
> >>  "undefined variable" with no variable name or line number to go by.
> >
> >I'm pretty sure that the log file reports which directories where loaded by
> >the file resource loader. If the file isn't found in that directory then it
> >is pretty clear where the problem is.
> >
> >>  The filename was was obvious by inspection. What wasn't was the path
> >>  being searched.
> >
> >Eh?
> >
> >Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader : initialization
> >starting.
> >Fri Jul 13 12:16:03 PDT 2001   [info] FileResourceLoader : adding path
> >'/Users/jon/checkout/scarab/target/webapps/scarab/WEB-INF/src/torque/templat
> >es'
> 
> I found the log file I was referring to. You must be using a different version.
> 
> Mon Jul 09 12:46:53 EDT 2001 AvalonLogSystem initialized using
> logfile /jwaa/velocity.log
> Mon Jul 09 12:46:53 EDT 2001   [info]   [info] Default Properties
> File: org/apache/velocity/runtime/defaults/velocity.properties
> Mon Jul 09 12:46:53 EDT 2001   [info] Resource Loader Instantiated:
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader :
> initialization starting.
> Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader : adding path '.'
> Mon Jul 09 12:46:53 EDT 2001   [info] FileResourceLoader :
> initialization complete.
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Literal
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Macro
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Parse
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Include
> Mon Jul 09 12:46:53 EDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Foreach
> Mon Jul 09 12:46:53 EDT 2001   [info] Created: 20 parsers.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization starting.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : adding VMs from
> VM library template : VM_global_library.vm
> Mon Jul 09 12:46:53 EDT 2001  [error] ResourceManager : unable to
> find resource 'VM_global_library.vm' in any resource loader.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : error using  VM
> library template VM_global_library.vm :
> org.apache.velocity.exception.ResourceNotFoundException: Unable to
> find resource 'VM_global_library.vm'
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInline =
> true : VMs can be defined inline in templates
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro :
> allowInlineToOverride = false : VMs defined inline may NOT replace
> previous VM definitions
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : allowInlineLocal
> = false : VMs defined inline will be  global in scope if allowed.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : messages on  : VM
> system will output logging messages
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocimacro : initialization complete.
> Mon Jul 09 12:46:53 EDT 2001   [info] Velocity successfully started.
> 
> I still assert that "Couldn't find Template.tmp in [ pathname1,
> pathname2 ] would have
> been far more useful than ".". And what the heck is
> VM_global_library.vm, and why can't
> it be found? It was wondering about that one that made me try adding
> "class" to the loader list.

RTFM.  Or ask. We are here and eager to help and improve.
 
> >"using Jakarta"????????????????????????
> 
> I meant Velocity.

big difference.
 
> >  >, users have to download, understand, and install
> >>  apache, a connector (JServ, mod_jk, etc), and tomcat, each with its
> >>  own configuration file peculariaties, each of which is tested only
> >>  for syntactic validity, with any semantic invalidity exposed so that
> >>  NullPointerExceptions turn up at runtime.
> >
> >The problem is that it is very difficult to guess every single different
> >configuration and use of our software as well as catch that usage perfectly.
> >We try our best, but sometimes it isn't always easy.
> >
> >Needless to say, I'm not really sure what the point of what you are trying
> >to say is. Are you saying that we should make things easier for our users?
> >Are you saying that we intentionally make things difficult? If so, then let
> >me point you at this document:
> 
> Jon, try taking what I've been saying at face value instead of trying
> to make everything a confrontation. I've made a number of very
> concrete technical proposals: 

> Abstract classes over properties files,

I think an impossibility for real-world production.... 

> static over dynamic binding, 

we will battle this to a standstill - it's clearly preference.

>the need for both semantic and syntactic
> checks on all external data (especially properties files), 

Agreed 100%

> avoiding
> Strings/nulls in favor of application-specific Field types and many
> others.

Maybe, certainly in some cases.

>I've absolutely no interest in playing games or picking
> fights.
> 
> >     <http://jakarta.apache.org/site/understandingopensource.html>
> 
> Yeah. Pitch in and help a group that slaps down other ideas this readily?

Please.  Nothing has been slapped down...  this is actually a great
group to discuss alternative ideas.  We have multiple competing
frameworks that have an interest in velocity, and we all get along.  We
crosstalk with the wayward heathens over in WebMacro-land (That was a
joke...), and I have even joined the taglibs expert group hoping to
crosspollinate ideas between the two communities.  It's not all or
nothing.  Most, nay, the majority, in this community are working web
developers, and have a real interest in getting things done better and
faster.  That's why they took a look at Velocity - it seems that many
like what they found compared to the alternatives, and stayed...

> 
> >All the information you needed was in the log file. See above.
> 
> Yeah. Everything in that ".". Mea culpa.

Come on... it was there.  It's not perfect.  But it was there.


geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Mime
View raw message