Best practice to manage the path breadcrumbs in Spring without Web flow

I am engaged in a project where I need to show path bread crumbs to the user like

Home (This is linked to home page) >> (page name)

and like

Home >> contacts

and in contacts like

Contacts >> create
Contacts >> edit

etc.

Is there a best practice how to do this in spring without he usage of spring web flow? I am not using spring web flow and simply using the spring MVC.


I'm not sure why you'd have to do this in Spring if you're not using Spring MVC.

Depending on the site's structure and the URL structure, you might want to parse the URL into something readable.

Another option is to have some sort of push/pop mechanism but since browsers have a back button which does not signal the server this is often a recipe for disaster.


I'm not sure there is any universal solution for breadcrumbs. Here are a few variants:

  • use the URL structure. With spring mvc this is actually a very good option, since it (since 2.5) replies a lot on nice, structured URLs
  • have each page (view) identify its own path in the breadcrumb (via a request parameter). It's not
  • place current steps in session. This would break if multiple tabs/windows are used, so you will have to use a windowId .. and essentially roll-out a "crippled" webflow.

  • This sort of breadcrumbs is sometimes called homeward path navigation.

    If you can capture your site layout in XML then an XSL could be used to generate the breadcrumbs. The same XML site layout document could also be used to generate a side navigation menu.

    See also: Separating breadcrumb (homeward path) navigation from content using XML/XSL.

    链接地址: http://www.djcxy.com/p/1020.html

    上一篇: 为什么在ajax请求上调用abort()会导致ASP.Net MVC(IE8)错误

    下一篇: 在没有Web流的情况下管理Spring路径面包屑的最佳实践