zoukankan      html  css  js  c++  java
  • 20151113--JSTL

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>测试JSTL (Java标准标签库)</title>
    </head>
    <body>
    <%
    //session.setAttribute("test", "测试内容");
    //request.setAttribute("test", "测试内容2");
    //application.setAttribute("test", "测试内容3");
    
    com.hanqi.dao.User user1 = new com.hanqi.dao.User();
    request.setAttribute("user1", user1);
    
    //session.setAttribute("user1", user1);
    %>
    <c:catch var="error"></c:catch>
    <c:out value="${error }"/>
    <c:remove var="user1" scope="session"/>
    
    <c:set var="test" value="标签测试内容" scope="request"/>
    <jsp:useBean class="com.hanqi.dao.User" id="user" />
    <c:set target="${user1 }" property="username" value="测1试用户123" />
    
    
    <c:out value="${user1.username }"></c:out>
    <c:out value="${user1.getUsername() }"></c:out>
    
    
    <br>
    <c:out value=" ${test }<hr>" escapeXml="true"  default="默认值"></c:out>
    <%=
        "你好2 <hr>"     
    %>
    
    ${
        "你好3<hr>" 
    }
    
    <%
        out.print("你好4<hr>");
        out.write("你好5  &lt hr &gt");
    %>
    
    </body>
    </html>
    1

  • 相关阅读:
    《leetcode42接雨水》
    《84. 柱状图中最大的矩形》
    [bzoj1565][NOI2009]植物大战僵尸
    [bzoj1497][NOI2006]最大获利
    [洛谷P4092][HEOI2016/TJOI2016]树
    [洛谷P3760][TJOI2017]异或和
    [洛谷P3758][TJOI2017]可乐
    [洛谷P3761][TJOI2017]城市
    [Uva11134]Fabled Rooks
    又是一年叶落时
  • 原文地址:https://www.cnblogs.com/name-hanlin/p/5043394.html
Copyright © 2011-2022 走看看