zoukankan      html  css  js  c++  java
  • 对Web作用域变量进行迭代

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
    <html>
    <head>
        <title>主页</title>
    </head>
    <body>
        <table border="1">
            <caption>page作用域迭代</caption>
            <tr>
                <td></td>
                <td></td>
            </tr>
            <c:forEach items="${pageScope}" var="oneAttr">
                <tr>
                    <td>${oneAttr.key}</td>
                    <td>${oneAttr.value}</td>
                </tr>
            </c:forEach>
        </table>
        <hr/>
        <table border="1">
            <caption>request作用域迭代</caption>
            <tr>
                <td></td>
                <td></td>
            </tr>
            <c:forEach items="${requestScope}" var="oneAttr">
                <tr>
                    <td>${oneAttr.key}</td>
                    <td>${oneAttr.value}</td>
                </tr>
            </c:forEach>
        </table>
        <hr/>
        <table border="1">
            <caption>session作用域迭代</caption>
            <tr>
                <td></td>
                <td></td>
            </tr>
            <c:forEach items="${sessionScope}" var="oneAttr">
                <tr>
                    <td>${oneAttr.key}</td>
                    <td>${oneAttr.value}</td>
                </tr>
            </c:forEach>
        </table>
        <hr/>
        <table border="1">
            <caption>application作用域迭代</caption>
            <tr>
                <td></td>
                <td></td>
            </tr>
            <c:forEach items="${applicationScope}" var="oneAttr">
                <tr>
                    <td>${oneAttr.key}</td>
                    <td>${oneAttr.value}</td>
                </tr>
            </c:forEach>
        </table>
        <hr/>
    </body>
    </html>
  • 相关阅读:
    Solved:Spring Junit Test NoSuchMethodError
    Stack实现
    CLRS10.2-8练习
    CLRS10.2-7练习
    CLRS10.2-4练习
    CLRS10.1-7练习
    CLRS10.1-6练习
    算法:吸血鬼数字算法
    CLRS最大子数组问题
    VS快捷键
  • 原文地址:https://www.cnblogs.com/sherrykid/p/4573869.html
Copyright © 2011-2022 走看看