Results 1 to 2 of 2

Thread: How to create default beans accessible by every page ?

  1. #1

    Default How to create default beans accessible by every page ?

    I would like to have certain objects accessible in every page of my webapp.
    I have a JavaScript menu that I want to generate dynamically from the DB, and as the menu is on every page, I will need the DAo object in every page.

    Ideally I could use <jsp:useBean> tag to retrieve them in the page.

    What is the best way to achieve this ?

    Do I need to place them in the ModelAndView in every controller that I have, or should I override DispatcherServlet and stick them in the page context ?

    But how about simple JSP files that do not use controller ?

    Thanks for any help

    Matt

  2. #2
    Join Date
    Jun 2005
    Posts
    13

    Default

    one way is to have an interceptor which will stick these objects in the model in postHandle method:
    Code:
    	modelAndView.addObject&#40;"objectName", objectValue&#41;;

Similar Threads

  1. Pageable data list with Hibernate
    By robmorgan in forum Data
    Replies: 23
    Last Post: Jul 24th, 2006, 06:12 PM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  4. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

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