Simply put, it’s basically a data driven page. Pull data from somewhere, do a bit of processing/logic and render it to the user.
A simple recipe for prototyping:
I’m using jstl to get my data and displaytable to render the data. This combination lets me prototype a page using only 3 tags:
// Set the data source
<sql:setDataSource dataSource=”[DATASOURCE]”/>
Use the data source name in your [application].xml file
// Do the query
<sql:query var=”results”>
[Your Query Goes Here]
</sql:query>
Once you do that, you can use display table to render the results
// Open the table
<display:table style=name=”pageScope.results.rows” >
// If you need to get access to the object, do something like this:
<% SortedMap m = (SortedMap) row; %>
// Here is a simple way to render one of your columns:
< display:column property=”[columnName]” title=”Simple Column”/>
// Or a more complex way (in case u need to do processing
<display:column title=”Complex Column”>
<%=(String)m.get(“ColumnName”)%>
</display:column>
// Don’t forget to close your table!
</display:table>
Why this works so well
Basically, the key to prototyping is speed and flexibility. All the data and logic for this prototype is in one file. Tweak the query and the UI as you need to… Once everyone is happy with the results, then you can review the prototype and migrate the code to the proper places.




















Leave a Reply