zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    爬虫工程师分享:三步就搞定 Android 逆向
    爬虫工程师常用的 Chrome 插件
    Python 描述符(Descriptor) 附实例
    爬虫必备:Python 执行 JS 代码 —— PyExecJS、PyV8、Js2Py
    京东白条
    中国金融贷款整理
    接口文档管理工具YApi内网服务器搭建过程
    AWS申请图文及连接教程
    金融
    centos jdk 1.7升级到1.8后显示还是1.7
  • 原文地址:https://www.cnblogs.com/beast-king/p/5537332.html
Copyright © 2011-2022 走看看