Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

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
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!