Al Hobbs wrote:It's probably a much better idea to organize it in the servlet, then you can have your sections for different types with their own array of items.
If you do not wish to antagonize the Bear, use the
JSP as a View Template and put the Model Data into JavaBeans created and managed by a Controller Servlet. If you put logic on the View Template (JSP), you will offend him.
Actually, although I prefer other frameworks, no matter which framework you use, don't put logic on the View. When you do this A) it's a
to debug, since JSPs are not designed to be executed/debuggable code units and B) you've created a "Treasure Hunt" situation where you have to bop around looking for what gets done where. Was it in the JSP? Was it in the servlet? Ganesha help me! It's both! if I change it here, I have to remember to change the corresponding other part over there! And forget about sharing the resource anywhere else, because then you're hunting Easter Eggs.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.