If you put the repository in the user's session, that should be used
instead.
The following code starts with page scope, then looks in request,
session and applications scopes:
// get the menu repository
MenuRepository rep =
(MenuRepository) pageContext.findAttribute
(this.repository);
You can override the default name by using repository="yourname" on
useMenuDisplayer tag:
/**
* This method allows users to override the key used to lookup the
* repository. If not specified - the default repository is
used, which is
* "net.sf.navigator.MENU_REPOSITORY" or
* UseMenuDisplayerTag.MENU_REPOSITORY_KEY.
* @param repository
*/
public void setRepository(String repository) {
this.repository = repository;
}
HTH,
Matt
On Feb 14, 2008, at 6:25 AM, Rob Hills wrote:
Hi All,
My app is based on AppFuse 2.0 + Struts etc and I'm using the
default struts-menu to build my app menu.
In this app, each user belongs to a company and a company has an
associated set of reports. The spec calls for
the reports to be selectable from a dropdown menu and for each
company's users to see only their company's
reports.
I have created an ApplicationListener that fires off when the user
logs in and loads up the list of reports for that
user's company. However, I've discovered that the Struts Menu
repository is stored at the Application scope level
and so if I modify it for User A from Company A, when User B from
Company B logs in, the Reports dropdown
menu for the whole App is changed to that of Company B.
Does anyone know if there's some way of configuring Struts Menu to
use a menu repository cached at the Session
level rather than the Application level?
TIA,
Rob Hills
Waikiki, Western Australia
Mobile +61 (412) 904-357
Fax: +61 (8) 9529-2137
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]