I have been considering a range of options to move away form using scriptlets in my jsps.
The main cause of “messiness” tends to be the problems with printing out ArrayList and other Collections objects, because some presentation related markup gets mixed up with some Java.
What would you recommend as the best solution for dealing with this type of situation. I am looking at Wicket (very briefly) but can’t work out if this will help to clean up this situation.
If you’re using plain JSP, without any other Web framework on top of it, I suggest you take a look a the JSTL. It gives you a lot of tags to manipulate your objects.
One tag that might interest you in your case is the
<c:forEach />tag. It allows you to use for-each loops inside your JSP pages.For more informations, here are some links: