aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts-Menu with  Struts 2 " Watch "Struts-Menu with  Struts 2 " New topic
Author

Struts-Menu with Struts 2

raj nagaraju
Greenhorn

Joined: Nov 21, 2008
Posts: 7
Hi

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.
Raj
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.

http://www.vaannila.com/struts-2/struts-2-example/struts-2-tiles-example-1.html


Thanks,
Vikash Anand.
raj nagaraju
Greenhorn

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.

Regards
Raj
raj nagaraju
Greenhorn

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
<listener>
<listener-class>net.sf.navigator.menu.MenuContextListener</listener-class>
</listener>

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.

Regards
Raj
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts-Menu with Struts 2