JSP、JSTL、EF學習筆記

來源:互聯網
上載者:User

標籤:jsp指令   requests   htm   筆記   file   其他   index.jsp   remove   代碼   

JSP1)Java Server Page,在html中嵌入java代碼2)九個內建(隱式)對象requestresponseoutpagepageContextconfigsessionapplicationException3)JSP指令<%@ page ... %>Page指令,定義頁面屬性eg:<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%><%@ include ... %>包含其他檔案eg:<%@ include file="../common/comm.jsp"%><%@ taglib ... %>引入標籤庫的定義eg:<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>JSTL1)JSP Standard Tag Libarayhttp://www.runoob.com/jsp/jsp-jstl.html2)四類標籤核心(core)標籤格式化(format)標籤SQL標籤XML標籤3)標籤的使用(以核心標籤為例)a.在web.xml中配置<jsp-config><taglib><taglib-uri>http://java.sun.com/jstl/core</taglib-uri><taglib-location>/WEB-INF/taglib/c.tld</taglib-location></taglib></jsp-config>b.在jsp頁面中添加<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>4)核心標籤<c:out ></c:out><c:set var="" value="" scope=""/>scope可選,預設為page<c:remove var="" scope=""/>同set<c:url value="/index.jsp"/>會自動在value前添加項目名,即project_name/index.jsp,亦等同於${pageContext.request.contextPath}/inedx.jsp的效果<c:if test="${condition}" val="" scope="">do something...</c:if><c:choose><c:when test="${condition}">do something...</d:when><c:when test="${condition}">do something...</d:when><c:when test="${condition}">do something...</d:when><c:otherwise test="${condition}">do something...</d:otherwise></c:choose><c: forEach val="" items="">do something...</c:forEach>items為傳入的集合,val是每一項EL1)Expression Languagehttp://www.runoob.com/jsp/jsp-expression-language.html2)十一個內建(隱式)對象pageScoperequestScopesessionScopeapplicationScopeparamparamValuesheaderheaderValuesinitParamcookiepageContext

JSP、JSTL、EF學習筆記

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.