Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    406
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I do this with jsp?

    I am creating a new website for my company. So there are altogether 25-30 pages and in all the pages the top portion,the left nav bar and the footer is similar. So I am planning to split these into templates (a top navbar, left side bar, middle content - this will be different for different pages, a footer). How can I use a jsp includes to do this project? Meaning when I split these pages the portions would be named as .txt? Then I have to use a jsp to call all these .txt to make the right page? Can some one please give me a little explanation how this could be done?

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    jsp includes

    JSP files can be made into include files.

    In the main jsp file you would have

    <%@ include file="Header.jsp"%>

    The partial jsp file (Header.jsp) would contain the code that is needed to reuse.

    There is one book (can't remember which right now) that suggests that the partial jsp files be named .jspf that way you can tell your IDE not to check those files. I have not used that convention but it makes sense.

    Rita


  •  

    Posting Permissions

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