반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- postorder
- web 사진
- paragraph
- 웹 용어
- web 용어
- java역사
- web
- 머신러닝
- discrete_scatter
- 자료구조
- 재귀함수
- C언어
- 결합전문기관
- CES 2O21 참가
- broscoding
- html
- bccard
- pycharm
- mglearn
- Keras
- tensorflow
- vscode
- 대이터
- CES 2O21 참여
- KNeighborsClassifier
- web 개발
- inorder
- classification
- cudnn
- 데이터전문기관
Archives
- Today
- Total
bro's coding
EL.parameter 본문
반응형
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>EL parameter</title>
</head>
<body>
<a href="step2-2.jsp?command=insert&name=아이유">gogo</a>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>EL parameter</title>
</head>
<body>
1. scriptlet 방식:
<%=request.getParameter("command")%>
<%=request.getParameter("name")%>
<%=request.getParameter("age")%><%-- null 이 출력됨 --%>
<hr>
<%-- EL에서 null은 보여주지 않는다 --%>
2. EL 방식: ${param.command } ${param.name } ${param.age}
<form action="step2-3.jsp">
별명<input type="text" name="nick" required="required"><br>
나이<input type="number" name="age" required="required"><br>
<input type="submit" value="등록">
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>EL parameter</title>
</head>
<body>
1. scriptlet 방식:
<%=request.getParameter("nick")%>
<%-- 나이에 +1 --%>
<%
int age = Integer.parseInt(request.getParameter("age"));
%>
<%=age + 1%>
<%=request.getParameter("age") + 1%>
<hr>
2. EL 방식 ${param.nick} ${param.age+1 }
<%-- EL은 자동 형변환 --%>
</body>
</html>
반응형
'[IT] > JSP' 카테고리의 다른 글
JSTL.if (0) | 2021.04.23 |
---|---|
JSTL.taglib (0) | 2021.04.23 |
EL.ServletContext (0) | 2021.04.23 |
EL.session (0) | 2021.04.23 |
EL.Class 접근 (0) | 2021.04.23 |
EL (0) | 2021.04.22 |
JSP.Sample Code (0) | 2021.04.12 |
JSP.basic (0) | 2021.04.08 |
Comments