Results 1 to 4 of 4
  1. #1
    dkirvan is offline Member
    Join Date
    Oct 2008
    Posts
    4
    Rep Power
    0

    Default decorator.jsp problem building Struts Menu in JSP when Struts action is used

    I am using JSP, Struts and sitemesh in several web apps. After signing onto to the system the home page is displayed with the struts menu at top and a navigation menu along the left side of the jsp page. I am using a decorator.jsp to build the completed jsp page. If I click on a menu option or navigation option that calls a struts action class and then processes the new jsp the building of the new jsp fails when it is rebuilding the struts menu jsp. If I click on a link that calls another jsp with out struts action involved then the jsp is built with out any problems.

    The error I am receiving is

    878756 [http-8080-Processor25] (MessageResourcesMenuDisplayer.java:72) DEBUG net.sf.navigator.displayer.ListMenuDisplayer - Looking up message 'ToDoListMenuProject' in Struts' MessageResources
    java.lang.ClassCastException: org.apache.struts.util.PropertyMessageResources
    at net.sf.navigator.displayer.MessageResourcesMenuDis player.getMessage(MessageResourcesMenuDisplayer.ja va:76)
    at net.sf.navigator.displayer.ListMenuDisplayer.displ ayComponents(ListMenuDisplayer.java:52)
    at net.sf.navigator.displayer.ListMenuDisplayer.displ ay(ListMenuDisplayer.java:41)
    at net.sf.navigator.taglib.DisplayMenuTag.doStartTag( DisplayMenuTag.java:100)
    at org.apache.jsp.jsp.decorator_jsp._jspx_meth_menu_d isplayMenu_0(decorator_jsp.java:574)

    I have this code in my struts-config

    <plug-in className="net.sf.navigator.menu.MenuPlugIn">
    <set-property property="menuConfig" value="/WEB-INF/menu-config.xml" />
    </plug-in>



    The menu-config.xml is
    <?xml version="1.0" encoding="UTF-8"?>
    <MenuConfig>
    <Displayers>
    <Displayer name="DropDown"
    type="net.sf.navigator.displayer.DropDownMenuDispl ayer" />
    <Displayer name="ListMenu"
    type="net.sf.navigator.displayer.ListMenuDisplayer " />
    </Displayers>
    <Menus>
    <Menu name="ToDoListMenuProject" title="Project" description="test"
    width="200">
    <Item name="TDLteam" title="Team">
    <Item name="TDLjohn" title="John"
    page="/johnD.do" width="40" />
    <Item name="TDLdoug" title="Doug"
    page="/dougT.do" width="40" />
    <Item name="TDLshirley" title="Shirley"
    page="/shirleyS.do" width="40" />
    <Item name="TDLdavid" title="David"
    page="/jsp/davidK.jsp" width="40" />
    </Item>
    </Menu>

    <Menu name="ToDoListMenuList" title="Filter" width="200">
    <Item name="TDLactiveItems" title="Active Items"
    page="${filterActive}" width="100" />
    <Item name="TDLallItems" title="All Items"
    page="${filterAll}" width="100" />
    <Item name="TDLdeletedItems" title="Deleted Items"
    page="${filterDeleted}" width="150" />
    </Menu>

    <Menu name="ToDoListSelectCompany" title="Company" width="100">
    <Item name="TDLagriStats" title="Agri Stats"
    page="/home.do?do=compAgriStats" width="190" />
    <Item name="TDLexpressMarkets" title="Express Markets"
    page="/home.do?do=compExpressMarkets" width="190" />
    </Menu>


    <Menu name="ToDoListMenuLogoff" title="Log Out" description="LogOut"
    width="200">
    <Item name="TDLlogout" title="LOG OUT"
    page="/logon.do?do=showLogon" width="100" />
    </Menu>

    </Menus>
    </MenuConfig>

  2. #2
    dkirvan is offline Member
    Join Date
    Oct 2008
    Posts
    4
    Rep Power
    0

    Default

    Problem Resolved:
    I had to put the struts.jar and struts-menu-2.4.3.jar in the common/lib for tomcat and remove them from the individual web-app's lib directory. In addition, I had to coppy the commons.*.jars to common/lib for tomcat except for the commons.logging.jar which caused problems if removed from the individual web-app's directory.

  3. #3
    whiteasshweta is offline Member
    Join Date
    Jul 2009
    Posts
    6
    Rep Power
    0

    Default

    Can you please tell me whether you are using struts 1 or 2..............

  4. #4
    ashuiitr is offline Member
    Join Date
    Apr 2010
    Posts
    1
    Rep Power
    0

    Default Menu Dissapears after session time out and login again

    After session time out if i click on a link ,it redirect to login page.
    After login i came back on the same page which clicked earlier but menu dissapears.

Similar Threads

  1. Problem with Struts Menu
    By sdp in forum Advanced Java
    Replies: 4
    Last Post: 10-02-2009, 03:13 AM
  2. Struts Menu Component
    By bksamrat in forum Web Frameworks
    Replies: 0
    Last Post: 06-04-2008, 08:54 AM
  3. Action class in Struts
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-27-2007, 11:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •