학원/JSP

12_JSP

행수쌤 2023. 2. 19. 21:53
728x90
반응형

<img>

<img src="주소" alt="설명" width=" " height=" ">

<a>

<a href="주소">

<form>

<form action="전송할 주소" method="post" enctype="multipart/form-data">
	<button>전송</button>
</form>

  · method : get, post 등 전송 방식 설정

  · enctype : 파일 업로드를 가능하게 해줌

<select> - <option>

<select name="넣을 값">
  <option value="넣을값" selected>표시이름</option> selected : 초기 표시 항목
  <option>넣을값</option>
</select>

<input>

<input name="넣을 값" type="number" placeholder="검색어" 
	value="${keyword}" readonly size="6" maxlength="6" 
    multiple accept="image/*">

  · type - number : 숫자만, text : 문자만, search : 작성 중 x표시, hidden : 입력창 숨기기, range : 입력 바, submit : 버튼

<input type="range" min="50" max="500" value="200" step="5"/>
<input type="submit" value="로그인">
<button type="submit">로그인</button>

  · password : 비밀번호 처리, tel : 전화번호 처리, date : 날짜입력
  · placeholder - 작성 전 써있는 글씨
  · value - 검색 후 남아있는 글씨
  · readonly - 입력창 잠그기
  · size, maxlength - 글자수 제한

  · multiple - 여러 개 입력받음

  · accept - 입력받는 MIME Type 또는 확장자 설정(accept=".png, .gif, .jpg")

<textarea>

<textarea name="boardContent" rows="10" cols="60">${edit.boardContent}</textarea>

<ul> 순서 없는 리스트 태그

<ul>
	<li>번호 : ${studentDto.no}</li>
</ul>

<ol> 순서 있는 리스트 태그

<ol>
	<li>번호 : ${studentDto.no}</li>
</ol>

 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:if>

<c:if test="${message == null}">
	<h2>메세지가 없어요</h2>
</c:if>

<c:choose> if-else 처럼 쓰임

<c:choose>
    <c:when test="${message == null}">메세지가 없어요</c:when>
    <c:otherwise>message = ${message}</c:otherwise>
</c:choose>

<c:forEach>

<c:forEach var="n" items="${lotto}">
	<h2>n= ${n}</h2>
</c:forEach>
<c:forEach var="i" begin="1" end="10" step="1">
	<h2>i=${i}</h2>
</c:forEach>

  · for(int n : lotto)와 동일  var : 변수명, items : 추출 대상

<table>

<table border="1" width="300" height="300">
    <thead>
        <tr>
         	<th>번호</th>
        </tr>
    </thead>
    <tbody>
        <tr>
        	<td colspan="5" align="right">
        </tr>
    </tbody>
</table>

  · colspan : 칸 병합, align : 정렬, rowspan : 줄 병합, valign : 수직정렬(top, middle, bottom)

728x90
반응형