• JSP---web.xml中设置前后台不同的头部和底部


    目录结构

    header.jspf 

    <%@ page pageEncoding="utf-8" %>
    <html>
    <head></head>
    <body>
    <h1 style="background:#999;color:#fff;padding:10px;">hello website.</h1>

    admin_header.jspf

    <%@ page pageEncoding="utf-8" %>
    <html>
    <head></head>
    <body>
    <h1 style="background:#999;color:#fff;padding:10px;">hello admin information management system.</h1>

    footer.jspf

    <%@ page import="java.util.Calendar"  pageEncoding="utf-8" %>
    <h1 style="background:#999;color:#fff;padding:10px;">&copy;2000-<%= Calendar.getInstance().get(Calendar.YEAR) %>  beast-king corp.</h1>

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"  
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    
        <jsp-config>
            <jsp-property-group>
                <url-pattern>/main/*</url-pattern>
                <page-encoding>UTF-8</page-encoding>
                <default-content-type>text/html</default-content-type>
                <include-prelude>/jspf/header.jspf</include-prelude>
                <include-coda>/jspf/footer.jspf</include-coda>
            </jsp-property-group>
            
            <jsp-property-group>
                <url-pattern>/admin/*</url-pattern>
                <page-encoding>UTF-8</page-encoding>
                <default-content-type>text/html</default-content-type>
                <include-prelude>/jspf/admin_header.jspf</include-prelude>
                <include-coda>/jspf/footer.jspf</include-coda>
            </jsp-property-group>
        </jsp-config>
    </web-app>
  • 相关阅读:
    MFC中DoDataExchange()的作用
    图片下面出现空白像素的问题解决
    nginx 的 autoindex on首页不显示的问题 按照下面几行要写上不然不行
    配置 PHP 的 Session 存储到 Redis
    redis4安装
    jumpserver安装
    mysql命令参数详解
    定制LNMP的RPM包
    NTP原理
    内网环境NTP服务及时间同步(CentOS6.x)配置和部署
  • 原文地址:https://www.cnblogs.com/beast-king/p/5537332.html
Copyright © 2020-2023  润新知