Where do you get the NPE at?

On Oct 6, 2004, at 3:03 PM, Robert Smith wrote:

That code gave me a null pointer exception. This is what I had to do:

MenuRepository defaultRepository =
(MenuRepository)getServletContext().getAttribute(MenuRepository.MENU_RE POSIT
ORY_KEY);
MenuComponent defaultmc = defaultRepository.getMenu("Home"); //Home is set
in my menu-config.xml
defaultmc.setLocation("\myhomepage.html"); //Gets changed here
defaultRepository.addMenu(defaultmc);
session.setAttribute("repository", defaultmc);


Robert

----- Original Message -----
From: "Matt Raible" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 06, 2004 3:19 PM
Subject: Re: [struts-menu] Setting menu tab at runtime



On Oct 6, 2004, at 11:53 AM, Robert Smith wrote:

Hello,
    I've been using the struts menu for a few weeks now, and I like
what I
see. I have a few questions if anyone can help:

1. I have about 5 main tabs with a few dozen submenus (using the nice
looking tabs menu). I need to add a "Home" menu to be the first main
tabbed
menu item, but the location of it needs to be set upon the user
logging in
(instead of being pulled from the menu-config.xml). In my login code (a
servlet), how would I do this?

You can grab the repository from the servlet context, modify it and stuff it into the user's session. This howto may help:

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


2. I'm using the TabbedMenuDisplayer, and changing tabs is slow. Has anyone experienced this?

What do you mean - the JavaScript/CSS seems slow - or the pages are slow to load?

Matt



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user



------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ struts-menu-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to