Does Spring provide a clean way for building menus?
I'm buildin开发者_StackOverflow中文版g a menu with Spring and I'm trying to understand if there is a clean way of doing this. By clean way I mean some module that allows the following:
- create a link on a menu entry only if the page shown is not the one to be linked;
- apply some CSS class depending on the condition above.
I've just ran accross the spring:url tag: does it have anything to do with what I'm looking for?
No, this is a complexity of user interface way beyond that offered by Spring MVC. You need something higher-level such as JSF or maybe a javascript framework like jquery-ui.
Of course, you could build it yourself using the low-parts provided by Spring MVC, but it's going to be a lot of work.
I would recommend you to have a look at Tiles 2 in combination with SpringMVC. Sample app available on Spring By Example, search for Simple Tiles 2 Spring MVC Webapp.
精彩评论