Results 1 to 3 of 3

Thread: Organizing templates

  1. #1
    Join Date
    Dec 2010
    Posts
    7

    Default Organizing templates

    Hi,
    I have a problem with organizing my webapp HTML templates, which essentially are JSPs.

    I want to have following structure:
    Code:
    WEB-INF/
          templates/
              modules/
                  home.jsp
                  users.jsp
                  settings.jsp
              layouts/
                  mobile.jsp
                  general.jsp
              index.jsp
    index.jsp dynamically includes mobile or general layout jsp which itself should dynamically include the corresponding jsp from modules.

    So, when the request like to /MyApp/showUsers.htm is being sent, I want my handler method to populate the model and return a String "users" to view resolver. The the view resolver should decide whether it's a mobile request or general and include index.jsp with params for layout and module (which was already set to "users").

    The question is: How to correctly organize all that?
    Last edited by inteloid; Dec 28th, 2010 at 03:01 AM.

  2. #2
    Join Date
    Dec 2010
    Posts
    315

    Default

    Quote Originally Posted by inteloid View Post
    Hi,
    I have a problem with organizing my webapp HTML templates, which essentially are JSPs.

    I want to have following structure:
    Code:
    WEB-INF/
          templates/
              modules/
                  home.jsp
                  users.jsp
                  settings.jsp
              layouts/
                  mobile.jsp
                  general.jsp
              index.jsp
    index.jsp dynamically includes mobile or general layout jsp which itself should dynamically include the corresponding jsp from modules.

    So, when the request like to /MyApp/showUsers.htm is being sent, I want my handler method to populate the model and return a String "users" to view resolver. The the view resolver should decide whether it's a mobile request or general and include index.jsp with params for layout and module (which was already set to "users").

    The question is: How to correctly organize all that?
    You might wanna try using Apache Tiles 2. It has easy support for JSP templates. Spring integrates well with it. Check this guide I wrote at http://krams915.blogspot.com/2010/12...tegration.html

  3. #3
    Join Date
    Dec 2010
    Posts
    7

    Default

    Thanks a lot, I'll check it out and let you know.

    BTW, Happy New Year!!! :-)

Posting Permissions

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