Skip to content

Commit 8440747

Browse files
committed
Added jsp folder in the MVCPractice section of a small course on Java EE
1 parent d1f330f commit 8440747

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<%--
2+
Для проверки работоспособности в браузере набираем (в моей версии настроек):
3+
http://localhost:8080/content-jstl-demo?id=7&test=hello_from_jsp
4+
произойдет обращение к сервлету content-jstl-demo
5+
--%>
6+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
7+
<html>
8+
<head>
9+
<title>Title</title>
10+
</head>
11+
<body>
12+
<%@ include file="header.jsp"%>
13+
<div>
14+
<span>Content. Проверка русской кодировки.</span>
15+
<p>flightDtoList size: ${requestScope.flightsSize} </p>
16+
<p>RequestScope flightsSize: ${requestScope.flights.size()} </p>
17+
<p>Id : ${requestScope.flights.get(0).id} </p>
18+
<p>Id 2: ${requestScope.flights[1].id} </p>
19+
<p>MAP Id 3: ${sessionScope.flightsMap[2]} </p>
20+
<p>JSESSION id: ${cookie["JSESSIONID"].value}, unique identifier </p>
21+
<p>Header: ${header["Cookie"]} </p>
22+
<p>Param id: ${param.id} </p>
23+
<p>Param test: ${param.test} </p>
24+
</div>
25+
<%@ include file="footer.jsp"%>
26+
</body>
27+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<%-- Директива 'page' указывает настройки 'контент-тайп' в данном случае кодировку UTF-8 --%>
2+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
3+
<H1> Footer. Низ страницы</H1>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<%-- Директива 'page' указывает настройки 'контент-тайп' в данном случае кодировку UTF-8 --%>
2+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
3+
<H1> Header. Верх страницы</H1>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
2+
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3+
<html>
4+
<head>
5+
<title>SimpleRegForm</title>
6+
</head>
7+
<body>
8+
<label action="/registration" method="post">
9+
10+
<label for="nameId"> <strong>Enter name:</strong>
11+
<input type="text" name="name" id="nameId" size="30">
12+
</label><br>
13+
14+
<label for="birthdayId"> <strong>Birthday:</strong>
15+
<input type="date" name="birthday" id="birthdayId">
16+
</label><br>
17+
18+
<label for="emailId"> <strong>Email:</strong>
19+
<input type="text" name="email" id="emailId" size="35">
20+
</label><br>
21+
22+
<label for="passId"> <strong>Enter password:</strong>
23+
<input type="password" name="password" id="passId" size="26">
24+
</label><p>
25+
26+
<label for="roleId"> <strong> Role: </strong>
27+
<select name="role" id="roleId">
28+
<c:forEach var="role" items="${requestScope.roles}">
29+
<option value="${role}">${role}</option>
30+
</c:forEach>
31+
</select>
32+
</label></p>
33+
34+
<c:forEach var="gender" items="${requestScope.genders}">
35+
<input type="radio" name="gender" value="${gender}"> <strong>${gender}</strong>
36+
<br>
37+
</c:forEach>
38+
39+
<button type="submit">SEND</button>
40+
</label>
41+
42+
<c:if test="${not empty requestScope.errors}">
43+
<div style="color: red">
44+
<c:forEach var="error" items="${requestScope.errors}">
45+
<span>${error.message}</span>
46+
<br>
47+
</c:forEach>
48+
</div>
49+
</c:if>
50+
51+
</form>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)