How to create a master page?

后端 未结 2 1111
长发绾君心
长发绾君心 2021-01-14 16:57

I need to create a master page in JSP to be used by other JSPs for them to have the same look and feel and menus. How can I do that in JSP?

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-14 17:50

    You can use either

    <%@ include file="/absoluteFragment.jsp" %>
    

    or

    
    

    To know the difference see also http://www.jguru.com/faq/view.jsp?EID=13517:

    The <%@include file="abc.jsp"%> directive acts like C "#include", pulling in the text of the included file and compiling it as if it were part of the including file. The included file can be any type (including HTML or text).

    The tag compiles the file as a separate JSP file, and embeds a call to it in the compiled JSP.

提交回复
热议问题