Gabriel Jeremiah Campbell has a Bachelor of Science Honours Degree in Applied Mathematics and Computer Science from the National University of Science and Technology (NUST). I am a Sun Certified Java Programmer(SCJP) and Sun Certified Web Component Developer(SCWCD). I have worked as Junior Lecturer in Computer Science for 3 years. I have been actively developing software in Java for 4 years. I have also coded in C/C++. When not at a computer (or thinking about a computer) I enjoy sci-fi movies, cycling, nature walks and photography. Gabriel Jeremiah is a DZone MVB and is not an employee of DZone and has posted 9 posts at DZone. You can read more from them at their website. View Full User Profile

Spring ROO and an Idea

12.01.2010
| 5857 views |
  • submit to reddit

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:

 

From http://gabrieljeremiahcampbell.wordpress.com/2010/11/30/spring-roo-and-an-idea/

Published at DZone with permission of Gabriel Jeremiah Campbell, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Rohit Virbhadre replied on Thu, 2011/09/29 - 9:09am

Hi,

 Thanks for the Idea.

Can we use Pagination with this, i.e the pagination.tagx generated by Spring roo.

Thanks & Regards,

Rohit

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.