#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Amersfoort, The Netherlands
    Posts
    10
    Rep Power
    0

    Question Including another page in a jsp


    I want to include a footer-file in every other webpage. The default name of the footer file is for example footer.jsp.

    In some cases, a specific customer has his specific version of a page. The pagename in that case is the default name extended with a string like "_XX"; example: Footer_XX.jsp.

    The pagename postfix is set in a session variable (and can be empty).

    At the end of every page, the include directive should look something like this: include file = Filename + the value of the seesion-variable postfix + .jsp

    I can't get this to work... any suggestions?

    Erwin
  2. #2
  3. Golden Member =p
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Final Frontier
    Posts
    9
    Rep Power
    0
    <jsp:include page="footer.jsp" flush="true"/> is the code...

    i have not seen any variation in this in terms of passing dynamic page names to it...

    there are other methods, i am sure this will help you:

    http://developer.java.sun.com/develo...ogramming/jsp/
  4. #3
  5. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Code:
    <%
    String footerPage = "footer";
    footerPage += session.getAttribute( "custFootId" );
    footerPage += ".jsp";
    %>
    
    <jsp:include page="<%=footerPage%>" flush="true"/>
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Amersfoort, The Netherlands
    Posts
    10
    Rep Power
    0
    Thanks again, Brikcker42

    Yet again it's You who's helping me out...

    Erwin

IMN logo majestic logo threadwatch logo seochat tools logo