How to create menu bar using Struts?


Web tier: servlets, JSP, Web frameworks: How to create menu bar using Struts?

  1. How to create menu bar using Struts? (1 messages)

    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?
  2. How to create menu bar using Struts?[ Go to top ]

    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.