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>
  • 相关阅读:
    译 PrestaShop开发者指南 第三篇 设置本地安装环境
    译 PrestaShop开发者指南 第二篇 代码规范
    [译]PrestaShop开发者指南 第一篇 基础
    Discuz!X3解读之类引入机制及目录结构
    Discuz的缓存体系
    x3d 规范 在线镜像版
    大容量数据库对表做分割
    链表 队列 堆栈 视频
    How ASP.NET MVC Works?
    SQLServer查看和解决死锁的方法
  • 原文地址:https://www.cnblogs.com/beast-king/p/5537332.html
Copyright © 2011-2022 走看看