Results 1 to 4 of 4

Thread: Tiles - dynamic content

  1. #1
    Join Date
    Nov 2009
    Posts
    24

    Default Tiles - dynamic content

    Hi
    It's my first time here, so please be forgiving.

    I'm starting my first Spring MVC project and I've got a problem with layouts (Tiles).
    I configured Tiles properly, but now I've got a problem with putting dynamic content into it.

    I want to have for example header with a list of categories (it's only an example). Categories are fetched from database, so it's dynamic content.

    I don't want to put in every action of controller an information about this categories, but to create something like View Helper.

    I read this forum and I found some posts about Interceptors and Filters but I haven't found any solution, how to configure it so that it works.

    Could you please tell me where I can find such tutorial? May a simple example application with Interceptors or Filters implemented.

    Maybe there is another solution to this problem ?

    Thanks in advance!

  2. #2

    Default

    If I understand your question correctly, that is not a Tiles related question. Why you can't retrieve the data with an application scope bean and display the data in a proper format?
    [URL="http://vicina.info"] 新闻,社区新闻,分类广告

  3. #3
    Join Date
    Dec 2009
    Posts
    20

    Default

    I have the same question here. I guess michalborek wants the list of catagories is displayed in a fixed area of the page just like a navigation menu. We don't want to add the list to every action of the controller. Since each controller action will return a view, and the list is shared by all views, we need a way to populate the list once for all views.

  4. #4
    Join Date
    Dec 2006
    Posts
    311

    Default

    Why not keep it clean and simple and create a BaseAbstractController to extend which has methods like referenceData or something similar (for annotated controllers) and use that to populate these lists for each view.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •