JSPベース
目次
- 1.結果
- 2.結果
- References
JSPベース
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String cnt_ = request.getParameter("cnt");
int cnt = 50;
if (cnt_ != null && !cnt_.equals("")) {
cnt = Integer.parseInt(cnt_);
}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
안녕
<% for(int i = 0; i<cnt; i++) { %>
안녕 Servlet<br>
<% } %>
</body>
</html>
1.結果
http://localhost:9090/basic.jsp

2.結果
form 태그
使用しないget방식
使用<%
String cnt_ = request.getParameter("cnt");
int cnt = 50;
if (cnt_ != null && !cnt_.equals("")) {
cnt = Integer.parseInt(cnt_);
}
%>
http://localhost:9090/basic.jsp?cnt=3

References
Servlet / JSP

Reference
この問題について(JSPベース), 我々は、より多くの情報をここで見つけました https://velog.io/@withcolinsong/JSP-기초テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol