Matt,

I changed my code to use session.setAttribute as you suggested. New code
looks like this:

HttpSession session = ServletActionContext.getRequest().getSession();
                                
Map servletContext = ActionContext.getContext().getApplication();
MenuRepository defaultRepository = (MenuRepository)
servletContext.get(MenuRepository.MENU_REPOSITORY_KEY);
if (session.getAttribute("repository") == null) {
        repository = new MenuRepository();
} else {
        repository = (MenuRepository)
session.getAttribute("repository");
}
repository.setDisplayers(defaultRepository.getDisplayers());
repository.removeAllMenus();
/* [CODE TO BUILD MENU . . .]*/

session.setAttribute("repository", repository);

However, we are still getting the same error. Any other ideas?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Healy, Kristen
Sent: Monday, March 03, 2008 2:50 PM
To: General mailing list for Struts Menu
Subject: Re: [struts-menu] "No Menu in Repository
withname[name]"occasionally displays

 Also, this error showed up in our log today:

2008-03-03 13:58:01,844 ERROR [jsp]:250 - Servlet.service() for servlet
jsp threw exception
javax.servlet.jsp.JspException: The menu repository could not be found.
        at
net.sf.navigator.taglib.UseMenuDisplayerTag.doStartTag(UseMenuDisplayerT
ag.java:140)
        at
org.apache.jsp.pages.userMenu_jsp._jspx_meth_menu_005fuseMenuDisplayer_0
05f0(userMenu_jsp.java:508)
        at
org.apache.jsp.pages.userMenu_jsp._jspService(userMenu_jsp.java:186)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:328)

-----Original Message-----
From: Healy, Kristen
Sent: Friday, February 29, 2008 9:22 AM
To: 'General mailing list for Struts Menu'
Subject: RE: [struts-menu] "No Menu in Repository with
name[name]"occasionally displays

Servlet container is Tomcat 5.5.

I'm using struts 2. My code looks like this:

Map session = ActionContext.getContext().getSession();
Map servletContext = ActionContext.getContext().getApplication();
MenuRepository defaultRepository = (MenuRepository)
servletContext.get(MenuRepository.MENU_REPOSITORY_KEY);
if (session.get("repository") == null) {
        repository = new MenuRepository();
} else {
        repository = (MenuRepository) session.get("repository"); }
repository.setDisplayers(defaultRepository.getDisplayers());
repository.removeAllMenus();
/* [CODE TO BUILD MENU . . .]*/

session.put("repository", repository);



The jsp for the menu looks like this:

<menu:useMenuDisplayer name="CSSListMenu" id="primary-nav"
repository="repository">
        
       <s:if test="#session.isAdmin">
     <menu:displayMenu name="AdminMenu"/>
     </s:if>
        <menu:displayMenu name="UserMenu"/>
     <s:if test="#session.isSponsor">
        <menu:displayMenu name="SponsorMenu"/>
     </s:if>
      <s:if test="#session.currUser.type == 'MA'">
      <menu:displayMenu name="MiscMenu"/>
      </s:if>
</menu:useMenuDisplayer>


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Matt Raible
Sent: Thursday, February 28, 2008 10:45 PM
To: General mailing list for Struts Menu
Subject: Re: [struts-menu] "No Menu in Repository with
name[name]"occasionally displays

session.put seems to be an old call - what about using
session.setAttribute()? What version of Servlets are you using? What
servlet container are you using?

Matt

On Thu, Feb 28, 2008 at 7:51 AM, Healy, Kristen
<[EMAIL PROTECTED]> wrote:
> Into the session.
>
>  session.put(MenuRepository.MENU_REPOSITORY_KEY, repository);
>
>  Users have up to 4 top-level drop-down menus in our system. When this

> happens, not all of the menus disappear - usually at least one of them

> remains. And it seems to happen only to heavy users of the system.
>
>  Thanks in advance for any further insights you might have.
>
>
> -----Original Message-----
>  From: [EMAIL PROTECTED]
>  [mailto:[EMAIL PROTECTED] On Behalf Of 
> Matt Raible
>  Sent: Wednesday, February 27, 2008 6:03 PM
>  To: General mailing list for Struts Menu
>  Subject: Re: [struts-menu] "No Menu in Repository with name 
> [name]"occasionally displays
>
>  Where are you putting the menu repository? Are you putting it in the 
> user's request or session?
>
>  Matt
>
>  On Wed, Feb 27, 2008 at 2:59 PM, Healy, Kristen 
> <[EMAIL PROTECTED]> wrote:
>  >
>  >
>  >
>  > I'm using the struts-menu with the CSSListMenu MenuDisplayer in a
> > struts 2 application. The menu is being created dynamically - I  >
> followed the example at  >
> http://demo.raibledesigns.com/struts-menu/dynamicMenu.jsp when coding 
> this.
>  >
>  > The problem I'm having is that the message "No Menu in Repository 
> with
>
>  > name [nameofmenu]" displays occasionally where a menu should be  > 
> displaying. I'm having a hard time tracking down the source of the  > 
> problem because it happens very rarely, only in our production  > 
> environment (can't get this to happen in development or test), and 
> with no discernable pattern.
>  >
>  > Any ideas what the source of the problem might be?
>  >
>  > Thank you.
>  >
>  >  This communication is the property of Qwest and may contain  > 
> confidential or privileged information. Unauthorized use of this  > 
> communication is strictly prohibited and may be unlawful. If you have
> > received this communication in error, please immediately notify the 
> > sender by reply e-mail and destroy all copies of the communication
> and  any attachments.
>  >
> ----------------------------------------------------------------------
>  > ---  This SF.net email is sponsored by: Microsoft  Defy all  > 
> challenges. Microsoft(R) Visual Studio 2008.
>  >  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  > _______________________________________________
>  >  struts-menu-user mailing list
>  >  struts-menu-user@lists.sourceforge.net
>  >  https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>  >
>  >
>
>
>
>  --
>  http://raibledesigns.com
>
>  
> ----------------------------------------------------------------------
> --
>
>
> -
>  This SF.net email is sponsored by: Microsoft Defy all challenges.
>  Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  struts-menu-user mailing list
>  struts-menu-user@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>
>  
> ----------------------------------------------------------------------
> ---  This SF.net email is sponsored by: Microsoft  Defy all 
> challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  struts-menu-user mailing list
>  struts-menu-user@lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/struts-menu-user
>



--
http://raibledesigns.com

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
struts-menu-user mailing list
struts-menu-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft Defy all challenges.
Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
struts-menu-user mailing list
struts-menu-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
struts-menu-user mailing list
struts-menu-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to