Spring ROO and an Idea
Join the DZone community and get the full member experience.Join For Free
i have being playing around with spring roo. it is a project with great potential and the facility to integrate seamlessly with maven is an added advantage.
there are many tutorials on “an enterprise java application in 10 minutes with roo”, this is not a tutorial but rather looks at enhancing roo for use in projects the reader who is unfamiliar with spring roo is advised to look at . http://www.springsource.org/roo for an introduction to spring roo.
how one draw back that seems to plague spring roo is the lack of sorting and filtering functionality on the web frontend lists. in other words how do we sort tabular data? this question is obviously an important one and vital to many web applications.
an answer that we could employ is displaytag a little known but help tag library that could assist us to sort and export tabular data to excel and csv files.
in the generated list.jspx we have:
if we had to use display tag instead we would have :
now we could actually make changes to the code generation and the annotations to alter and create our default jsps to use the display tag. however for this exercise we can assume that we did it by hand and produced the above.
the result when running the application with mvn tomcat:run we have in our browser( http://127.0.0.1:8080/truckmanagement/trucks?page=1&size=10 ):
we can even extend the above to use displaytags exporting abilities to export to excel:
Opinions expressed by DZone contributors are their own.