Skip to content

Instantly share code, notes, and snippets.

@jstrachan
Created March 11, 2010 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstrachan/329070 to your computer and use it in GitHub Desktop.
Save jstrachan/329070 to your computer and use it in GitHub Desktop.
<%@ val type: Class %>
\<%@ val it: ${type.getName%} %>
<table>
<% for (property <- introspect(type)) { %>
<tr>
<td>${property.label}</td>
<td>\${it.${property.name}}</td>
</tr>
<%}%>
</table>
which generates something like this: com.acme.Person.index.ssp
<%@ val it: com.acme.Person %>
<table>
<tr>
<td>Name</td>
<td>${it.name}</td>
</tr>
<tr>
<td>Address</td>
<td>${it.address}</td>
</tr>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment