Issue Details (XML | Word | Printable)

Key: SM-50
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Maarten Coene
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts Menu

NullPointerException when using useMenuDisplayer tag without id attribute

Created: 14/Jul/06 04:28 AM   Updated: 06/Oct/06 12:35 AM   Resolved: 06/Oct/06 12:35 AM
Component/s: Displayers
Affects Version/s: 2.4.1
Fix Version/s: 2.4.2


 Description  « Hide
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




Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 14/Jul/06 08:40 AM
Can you point to a URL where this happens on the demo site?

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

Maarten Coene added a comment - 14/Jul/06 10:13 AM
No, this happens when I deploy the examples on my local tomcat (version 4.1.30).

Matt Raible added a comment - 14/Jul/06 10:19 AM
What's the local URL (with localhost:8080, etc.)?