• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Struts-Menu with Struts 2

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic