Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts Menu

843840Dec 2 2007 — edited Dec 2 2007
Hey there. I'm not sure if I'm posting in the write forum, but here goes.

I do not have any prior experience with Struts, but according to the FAQ on the Struts Menu Site, I can use it without Struts:

Q: Can I use Struts Menu outside of a Struts Application?

A: In version 2.2, the Menu Repository can now be loaded using a MenuContextListener:+
<!--
   - Loads the menu-config.xml for struts-menu at startup,
   - by default from "/WEB-INF/menu-config.xml".
   - To override this, add a context-param named "menuConfigLocation"
   - web.xml file.
   -->
<listener>
    <listener-class>net.sf.navigator.menu.MenuContextListener</listener-class>
</listener>
So I added the above code to the menu-config.xml file.

So far what I've done by referring to some tutorials on chinese sites (i couldn't get a comprehensive tutorial in English):
1) added struts-menu-2.4.3 jar file to library
2) Added struts-menu.tld and struts-menu-el.tld to WEB-INF
3) Created menu-config.xml in WEB-INF
4) Added these to the web.xml file:
<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>TrackerRes</param-value>
</context-param>
<taglib>
    <taglib-uri>/tags/struts-menu</taglib-uri> 
    <taglib-location>/WEB-INF/tld/struts-menu.tld</taglib-location>
</taglib>
<taglib>   
    <taglib-uri>/tags/struts-menu-el</taglib-uri>   
    <taglib-location>/WEB-INF/tld/struts-menu-el.tld</taglib-location>
</taglib>
I get the following error when i tested it out:
org.apache.jasper.JasperException: Exception in JSP: /menu.jsp:16

14:     </head>
15:     <body>
16:         <menu:useMenuDisplayer name="CoolMenu" bundle="org.apache.struts.action.MESSAGE">
17:             <menu:displayMenu name="contactMenu"/>            
18:         </menu:useMenuDisplayer>
19:         <menu:useMenuDisplayer name="ListMenu" repository="repository">
The content in the menu-config.xml is actually an exact copy of what was written on the tutorials. And i am only 'testing' struts menu, with intention to get make it database driven. So this is really confusing to me, making me feel that i would have no hope of making the menu database driven at all!

Everywhere i see, people mention the struts-config file. Should i add the Struts library though i do not need to use it anywhere else? Are there any comprehensive tutorials out there? Sorry for asking such a vague question. And thanks for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2007
Added on Dec 2 2007
0 comments
268 views