Thomas Bednarz wrote:
Can I use Struts-menu in a VELOCITY ONLY environment without ANY jsp tag library? Are there any pointers about how to configure it and a sample vm file?

I'm currently doing this from within Spring. I'm using the Velocity code from struts-menu and the menu repository object. It's been useful, but far less so than if I was using from within a JSP. Mostly I'm using it to avoid recreating the functionality provided by the menu repository.


So within my controller, I place the menu repository into the equivalent of the Struts form bean (the command object) like so:

MenuRepository menuRepository = (MenuRepository) servletContext .getAttribute(MenuRepository.MENU_REPOSITORY_KEY);
command.setMenuRepository(menuRepository);


Then within my Velocity template I use displayMenu macro taken from struts-menu:

<div id="menuDiv">
        <ul id="menuList">
        #foreach ( $page in ["general", "items", "pricing", "sites"] )
                #displayMenu($command.menuRepository.getMenu($page) 0)
        #end
    </ul>
</div>

HTH,

Rob



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
struts-menu-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/struts-menu-user

Reply via email to