Can anybody suggest a good way to display a menu bar that contains valid links that a user is authorized for? I am using Struts with this application. For example, so far I have a servlet filter that queries the database for the valid modules that the current user can access. This list of modules is then put into an object and placed into the REQUEST object. Then, in my menubar.jsp, what is the best approach to retrieve that object from the REQUEST object and iterate over it to display it? I know I can do this by embedding JAVA in my JSP but I am trying to avoid that by using taglibs. I was wondering what set of JSP taglibs (if any) should I be using? Is there a better approach to what I am trying to do?
- Posted by: Quoc Le
- Posted on: December 18 2003 09:38 EST
Assuming you are on a Servlet 2.3, JSP 1.2+ compliant server, I suggest you use the tags in the JSTL tag library. These tags are part of the JSP standard as of JSP 2.0, and will be very widespread as that standard common more broadly supported.
If you are on an older server, use the Struts logic tags, which have an iterate tag.