File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts-Menu with  Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts-Menu with  Struts 2 " Watch "Struts-Menu with  Struts 2 " New topic

Struts-Menu with Struts 2

raj nagaraju

Joined: Nov 21, 2008
Posts: 7

I have been trying since yesterday to make it work Please guide me on how to use struts menu with struts 2. If possible please send me a working example.

Thank you.
Vikash Ananda
Ranch Hand

Joined: Oct 12, 2009
Posts: 32
Hi Raj,

I think you are looking for Tiles framework. Follow this link for a sample.

Vikash Anand.
raj nagaraju

Joined: Nov 21, 2008
Posts: 7
Hi Vikash Anand,

Thank you for your reply. But I am looking for a dynamic menu (website navigation based on user role) constructed from database.

raj nagaraju

Joined: Nov 21, 2008
Posts: 7
Finally I found the solution, thanks to Matt. Do the following to use struts menu with struts 2 (it is the same from user guide).

1. Added the follwoing in web.xml

2. Add the menu-config.xml in to WEB-INF.

3. Copy any jsp code from the project (the one you intended to use perhaps) into your jsp.

Then it will give you the following error:
javax.servlet.jsp.JspException: The menu repository could not be found.

This is the trick that is missing in user guide.

Add all the libraries from struts-menu-2.4.3\WEB-INF\lib

Thats it. Have fun.

It is sorta covered in the JavaRanch Style Guide.
subject: Struts-Menu with Struts 2
Similar Threads
menu is hiding under combo
dojo prevent cache error+struts 1.2
Menu implementation in Struts2
horizontal menu
Struts 2 Select list overlaps Coolmenus issue in IE 6