velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles N. Harvey III" <>
Subject RE: Experiences made by porting a JSP based application to Velocity (with Struts and Tomcat)
Date Thu, 05 Sep 2002 18:42:15 GMT
>One problem with Velocity is documentation. Of course you can generate
>JavaDocs out of your business logic classes. But how can you tell a Web
>Designer, which objects are available where (in which context). The only
>method I currently know is to write a HTML index page with some
>yourself (manually). Some improvment here would be helpful.

I was actually working on something like that.  Might take me a while since
I am really busy at work these days (and I don't even have a computer at
to save my sanity).  With most xml platforms you can add a request parameter
and you can see the xml stream so you can see all the variables that are in
the context.  So I was trying to do the same for Velocity.  Something like:


	ctx.put("context", context);

Then in VTL (pseudocode):

	#foreach ($key in $context.keys)
		$key : $context.get($key)
		#foreach($class in $key)

Something like that.  Because Velocity reads all public methods on all the
in the context.  So if you can load all the class names and method names
the context you should then be able to print them out nicely.

I had imagined it as an extra request parameter like
So when this is called a certain .vm file is used to display the foreach

If you can get it done faster than me go right ahead.  If I wasn't so busy
sure I could figure it out in a day or two (I'm still new to this java

Hope this was helpful.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message