PDA

View Full Version : What is the best approach for dynamic menus?


fsamir
Sep 30th, 2005, 07:05 PM
Hi,

I would like to use a few objects in all pages of my system. Something like the list of itens in a dynamic menu.

When I was using Struts I did it with the TilesController. Now I need something like this to use with Velocity and Sitemesh.

I thought in a ServletListener, but perhaps that is not the best approach. Any suggestions?
There is some kind of Listeners in Spring similar to TilesControllers?

adamjk
Oct 1st, 2005, 01:08 AM
You can still use Tiles for this in Spring.
http://static.springframework.org/spring/docs/1.2.x/reference/view.html#view-tiles

HandlerInterceptor can pre and post process calls to controllers (handlers to dispatcherservlet)
http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/web/servlet/HandlerInterceptor.html

fsamir
Oct 1st, 2005, 11:08 AM
Thank you Adam,

I can`t use Tiles because I`m already using Sitemesh.
The HandlerInterceptor is what that I'm using currently. I did it last night, and I'm still unhappy with this approach. But that is enough for now.

linus1412
Oct 3rd, 2005, 02:58 PM
Thank you Adam,

I can`t use Tiles because I`m already using Sitemesh.
The HandlerInterceptor is what that I'm using currently. I did it last night, and I'm still unhappy with this approach. But that is enough for now.

You can use both! I read somewhere that people have used Tiles for reuseable layout blocks, and SiteMesh to decorate their app.

Martin