You shouldn't need * on the end of your URLs. We use that in Acegi's
configuration to include any query strings that might be passed in.

Matt

On 5/3/07, Haotian Sun <[EMAIL PROTECTED]> wrote:

 The following is the old menu-config.xml, basically I removed the "roles"
from each menu item and use "url" as a reference to retrieve entitled roles
for each menu item. The reason why I have "*" at the end of each URL is that
I noticed in security.xml, when you denfie a URL, you have to follow the
apache Ant pattern which use "*" to refer to any other strings followed by
your URL. Something I may forget to tell is that each URL in my application
is based on role authorization, including those that represents the menu
items.

 <?xml version="1.0" encoding="UTF-8"?>
 <MenuConfig>
     <Displayers>
         <Displayer name="Velocity"
type="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
     </Displayers>
     <Menus>
         <Menu name="MainMenu" title="mainMenu.title"
page="/mainMenu.html"/>
         <Menu name="UserMenu" title="menu.user" description="User Menu"
forward="editProfile" roles="admin,user"/>
         <Menu name="DocServiceMenu" title="menu.docService"
description="DocService Management" width="100" page="/corpora.html"
roles="admin,user"/>
         <Menu name="WorkflowServiceMenu" title="menu.workflowService"
forward="processDefinitionList">
             <Item name="ListProcessDefinitions"
title="menu.workflow.process.definitions"
forward="processDefinitionList"/>
             <Item name="ListProcessInstances"
title="menu.workflow.process.instances"
forward="allProcessInstanceList"/>
             <Item name="ListTaskInstances"
title="menu.workflow.task.instances" forward="taskInstanceList"/>
             <Item name="PendingTaskInstances"
title="menu.workflow.pending.task.instances"
forward="pendingTasksList"/>
         </Menu>

         <Menu name="AdminMenu" title="menu.admin" description="Admin Menu"
roles="admin" width="120" forward="viewUsers">
             <Item name="ViewUsers" title="menu.admin.users"
forward="viewUsers"/>
             <Item name="ActiveUsers" title="mainMenu.activeUsers"
action="activeUsers"/>
             <Item name="ReloadContext" title="menu.admin.reload"
action="reload"/>
             <Item name="FlushCache" title="menu.flushCache"
action="flush"/>
             <Item name="Clickstream" title="menu.clickstream"
page="/clickstreams.jsp"/>
         </Menu>
         <Menu name="Logout" title="user.logout" page="/logout.jsp"
roles="admin,user"/>
     </Menus>
 </MenuConfig>

 Haotian


 Matt Raible wrote:
If you compare your new menu-config.xml to your old one, what's
 changed?  Also, why do you end some URLs with *?

 Matt

 On 5/3/07, Haotian Sun <[EMAIL PROTECTED]> wrote:


  well, I don't touch anything in web.xml but changed something in the other
 two. The following is the menu-config.xml

  <?xml version="1.0" encoding="UTF-8"?>
  <MenuConfig>
      <Displayers>
          <Displayer name="Velocity"
 type="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
      </Displayers>
      <Menus>
          <Menu name="MainMenu" title="mainMenu.title" page="/mainMenu.html"
 url="/mainManu.html"/>
          <Menu name="UserMenu" title="menu.user" description="User Menu"
 forward="editProfile"  url="/editProfile.html*"/>
          <Menu name="DocServiceMenu" title="menu.docService"
 description="DocService Management" width="100" page="/corpora.html"
 url="/corpora.html*" />

          <Menu name="WorkflowServiceMenu" title="menu.workflowService"
 page="/workFlowMenu.html" url="/workFlowMenu.html*" >
              <Item name="ListProcessDefinitions"
 title="menu.workflow.process.definitions"
 forward="processDefinitionList"
 url="/processDefinitionList.html?method=list*" />
              <Item name="ListProcessInstances"
 title="menu.workflow.process.instances"
 forward="allProcessInstanceList"
 url="/processInstanceList.html?method=listAll*" />
              <Item name="ListTaskInstances"
 title="menu.workflow.task.instances" forward="taskInstanceList"
 url="/taskInstanceList.html?method=list*" />
              <Item name="PendingTaskInstances"
 title="menu.workflow.pending.task.instances"
 forward="pendingTasksList"
 url="/taskInstanceList.html?method=listPending*" />
          </Menu>

          <Menu name="AdminMenu" title="menu.admin" description="Admin Menu"
 width="120" forward="viewUsers" url="/users.html*">
              <Item name="ViewUsers" title="menu.admin.users"
 forward="viewUsers" url="/users.html*"/>
              <Item name="ActiveUsers" title="mainMenu.activeUsers"
 action="activeUsers" url="/activeUsers.html*" />
              <Item name="ViewRoles" title="menu.admin.roles"
 forward="viewRoles" url="/roles.html*"/>
              <Item name="ViewResources" title="menu.admin.resources"
 forward="viewResources" url="/resources.html*"/>
              <Item name="ReloadContext" title="menu.admin.reload"
 action="reload" url="/reload.html*"/>
              <Item name="FlushCache" title="menu.flushCache" action="flush"
 url="/flush.html*"/>
              <Item name="Clickstream" title="menu.clickstream"
 page="/clickstreams.jsp" url="/clickstreams.jsp*"/>
          </Menu>
          <Menu name="Logout" title="user.logout" page="/logout.jsp"
 roles="admin,manager,user"/>
      </Menus>
  </MenuConfig>

  In menu.jsp, I use my own customized tag prefix executive which is defined
 in tablibs.jsp.

  <%@ include file="/common/taglibs.jsp"%>

  <executive:useMenuDisplayer name="Velocity"
 config="WEB-INF/classes/cssHorizontalMenu.vm"
 permissions="menusAdapter">
  <ul id="primary-nav" class="menuList">
      <li class="pad">&nbsp;</li>
      <c:if test="${empty pageContext.request.remoteUser}"><li><a
 href="<c:url value="/login.jsp"/>" class="current"><fmt:message
 key="login.title"/></a></li></c:if>
      <executive:displayMenu name="MainMenu"/>
      <executive:displayMenu name="UserMenu"/>
      <executive:displayMenu name="DocServiceMenu"/>
      <executive:displayMenu name="WorkflowServiceMenu"/>
      <executive:displayMenu name="AdminMenu"/>
  </ul>
  </executive:useMenuDisplayer>

  regards,

  Haotian


  Matt Raible wrote:
 There's 3 places it's configured:

  web.xml: MenuListener
  menu-config.xml
  menu.jsp

  I'd check to see if something looks out of whack in those files after
  you change everything.

  Matt

  On 5/3/07, Haotian Sun <[EMAIL PROTECTED]> wrote:

 right, I'll try that later. But for my question about why the struts
  menu disappears in the case that I described previously, do you have any
  idea?

  Thanks

  Haotian

  Matt Raible wrote:
  > You might be able to look at the "new" target and change it's logic so
  > it doesn't apply it to **/*.java files.
  >
  > Matt
  >
  > On 5/3/07, Haotian Sun <[EMAIL PROTECTED]> wrote:
  >> Hi Matt,
  >>
  >> Regarding to "it changes my current source code package structure", I
  >> mean it change the package name in my source code, for example if my
old
  >> project is called AAA and new one is named BBB, it changes from
  >> something like "org.AAA.dao" to "org.BBB.dao". What I want is to keep
  >> the old package name but just change the webapp name.
  >>
  >> Hope that's clear for you.
  >>
  >> Thanks
  >>
  >> Haotian
  >>
  >> Matt Raible wrote:
  >> > What do you mean by "it changes my current source code package
  >> > structure"?  What does it change it from/to?
  >> >
  >> > Matt
  >> >
  >> > On 5/3/07, James Sun <[EMAIL PROTECTED]> wrote:
  >> >> Well, if I do ant new , it will satisfy my goal but changes my
  >> current
  >> >> source package structure, which I'm not willing to see. So still
  >> needs
  >> >> suggestions...
  >> >>
  >> >> Cheers
  >> >>
  >> >> Haotian
  >> >>
  >> >> Haotian Sun wrote:
  >> >> > Hello guys,
  >> >> >
  >> >> > I've developed a webapp using Appfuse 1.9.4 with Struts for
  >> sometime,
  >> >> > now I just want to change the name of my webapp rather than
  >> touching
  >> >> > anything in my src package structure so far. What I think the
  >> easitest
  >> >> > way to test is to copy everything that is working in the current
  >> >> > webapp named A to an empty folder called B in my
  >> tomcat.home/webapp.
  >> >> > However the Struts menu disappers after I restart tomcat and
  >> load the
  >> >> > application. I've looked into the problem and found out that it is
  >> >> > caused by my customized Struts menu which is actually loaded
  >> >> > dynamically based on a role authorization(each url in the webapp
  >> has
  >> >> > been entitled for certain roles).  The following is the method
  >> from my
  >> >> > customized menu adapter:
  >> >> >
  >> >> > public boolean isAllowed(MenuComponent menu) {
  >> >> >      if(menu.getUrl()==null){
  >> >> >        return true;
  >> >> >      }else{
  >> >> >        String url=menu.getUrl();
  >> >> >        log.debug("$$$$$$$$$$$$$$ Menu.getUrl is "+url+"
  >> %%%%%%%%");
  >> >> >        url=url.substring(10)+"*";
  >> >> >        List allowedRoles =
 roleManager.getRolesWithResource(url);
  >> >> >        log.debug("The size of allowedRoles is
  >> "+allowedRoles.size());
  >> >> >        for(int i=0;i<allowedRoles.size();i++){
  >> >> >          Role allowedRole = (Role)allowedRoles.get(i);
  >> >> >          if(request.isUserInRole(allowedRole.getName())){
  >> >> >            return true;
  >> >> >          }
  >> >> >        }
  >> >> >      }
  >> >> >      return false;
  >> >> >      //return menuNames.contains(menu.getName());
  >> >> >  }
  >> >> >
  >> >> > After investigation on the debug info, I found that the URLs
  >> that are
  >> >> > used to represent the link of each menu item have the following
  >> format
  >> >> > in my original webapp A, for instance, "A/mainMenu.html". But it
  >> >> > changes to "B/mainMenu.html" once I just change the name of
  >> webapp. I
  >> >> > guess the problem is caused by Acegi security somewhere, but
  >> have no
  >> >> > idea so far. So I hope someone here can help me figure it out!
  >> >> >
  >> >> > Thanks in advance.
  >> >> >
  >> >> > Haotian Sun
  >> >> >
  >> >> >
  >> >> >
  >> >> >
  >>
---------------------------------------------------------------------
  >> >> > 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]
  >> >>
  >> >>
  >> >
  >> >
  >>
  >>
---------------------------------------------------------------------
  >> 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]












--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to