Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed webwork references.

...

Code Block
## prints out the property names for a bean
#macro (describeBean $name) 
#set($bu = $webwork$struts.bean("com.opensymphony.util.BeanUtils"))
	#foreach($propName in $bu.getPropertyNames($name))
		<li>$propName</li>
	#end
#end

...

Code Block
#describeBean($obj)

would print

Code Block
html
html

<li>firstName</li>

...


<li>lastName</li>

...


<li>zip</li>

One might also expand upon this to build a dynamic interface with via reflection. e.g.

...