Struts Menu
  1. Struts Menu
  2. SM-50

NullPointerException when using useMenuDisplayer tag without id attribute

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.4.2
    • Component/s: Displayers
    • Labels:
      None

      Description

      Hi,

      if I try the examples that comes with struts-menu 2.4.1, I receive the following NPE:

      java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:393)
      at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:234)
      at net.sf.navigator.taglib.UseMenuDisplayerTag.doStartTag(UseMenuDisplayerTag.java:223)
      at org.apache.jsp.coolmenu4_jsp._jspx_meth_menu_useMenuDisplayer_0(coolmenu4_jsp.java:159)
      at org.apache.jsp.coolmenu4_jsp._jspService(coolmenu4_jsp.java:83)

      This is caused because the id attribute on the useMenuDisplayer tag is not specified in the examples.
      For instance, the following JSP code causes this exception:

      <menu:useMenuDisplayer name="CoolMenu" bundle="org.apache.struts.action.MESSAGE">
      <menu:displayMenu name="ToDoListMenuFile"/>
      <menu:displayMenu name="ToDoListMenuEdit"/>
      <menu:displayMenu name="CaseDetailMenuCase"/>
      </menu:useMenuDisplayer>

      After adding an id attribute, everything worked well

        Activity

        Hide
        Matt Raible added a comment -

        Can you point to a URL where this happens on the demo site?

        http://demo.raibledesigns.com/struts-menu

        Show
        Matt Raible added a comment - Can you point to a URL where this happens on the demo site? http://demo.raibledesigns.com/struts-menu
        Hide
        Maarten Coene added a comment -

        No, this happens when I deploy the examples on my local tomcat (version 4.1.30).

        Show
        Maarten Coene added a comment - No, this happens when I deploy the examples on my local tomcat (version 4.1.30).
        Hide
        Matt Raible added a comment -

        What's the local URL (with localhost:8080, etc.)?

        Show
        Matt Raible added a comment - What's the local URL (with localhost:8080, etc.)?
        Show
        Maarten Coene added a comment - http://127.0.0.1:8080/struts-menu-2.4.1/coolmenu4.jsp

          People

          • Assignee:
            Matt Raible
            Reporter:
            Maarten Coene
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: