Search code examples
jqueryjspspring-mvcapache-tiles

Dynamic menu loading in jsp


i have web page which has menus Home, Sign in, mypage, searchshop.. . in case of successful login i will redirect to 'mypage'

below scenarios

on home page :-

Home , Signin & Sign up visible

on Successful login :-

mypage ,search shop and logoff menus visible and other menus should not display

and on logoff, i will show home page.

I am using jsp , apache tiles and spring mvc.

i need to load menus dynamically ,i have searched for samples but i didnt get one. Thanks


Solution

  • i have used two separate templates since i am using tiles. for home page i have separate menu and for other page i have another menu for same layout

    for home page

    ------------------------------
     header layout      |home menu
    ------------------------------
    
               body
                +
              footer
    ------------------------------
    

    and mypage , shops etc

    --------------------------------
     header layout      |mypage menu
    --------------------------------
    
               body
                +
              footer
    --------------------------------