zoukankan      html  css  js  c++  java
  • JSP、JSTL、EF学习笔记

    JSP
    1)Java Server Page,在html中嵌入java代码
    2)九个内置(隐式)对象
    	request
    	response
    	out
    	page
    	pageContext
    	config
    	session
    	application
    	Exception
    3)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" %>
    
    JSTL
    1)JSP Standard Tag Libaray
    	http://www.runoob.com/jsp/jsp-jstl.html
    2)四类标签
    	核心(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>
    			do something...
    		</d:otherwise>
    	</c:choose>
    	<c:forEach var="" items="">
    		do something...
    	</c:forEach>
    		items为传入的集合,val是每一项
    
    EL
    1)Expression Language
    	http://www.runoob.com/jsp/jsp-expression-language.html
    2)十一个内置(隐式)对象
    	pageScope
    	requestScope
    	sessionScope
    	applicationScope
    	param
    	paramValues
    	header
    	headerValues
    	initParam
    	cookie
    	pageContext
    
  • 相关阅读:
    oracle的安装与plsql的环境配置
    Working with MSDTC
    soapui-java.lang.Exception Failed to load url
    Oracle 一个owner访问另一个owner的table,不加owner
    Call API relation to TLS 1.2
    Call API HTTP header Authorization: Basic
    VS2008 .csproj cannot be opened.The project type is not supported by this installat
    The changes couldn't be completed.Please reboot your computer and try again.
    Create DB Table View Procedure
    DB Change
  • 原文地址:https://www.cnblogs.com/stonesingsong/p/7226156.html
Copyright © 2011-2022 走看看