Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_java2b_20250412
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
alx_java2b_20250412
Commits
7b686088
Commit
7b686088
authored
Apr 26, 2025
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pierwsze kroki JSP
parent
39a77ced
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
index.html
PC22-Serwlety/src/main/webapp/index.html
+2
-0
przyklad.jsp
PC22-Serwlety/src/main/webapp/przyklad.jsp
+42
-0
No files found.
PC22-Serwlety/src/main/webapp/index.html
View file @
7b686088
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
<li><a
href=
"ping"
>
ping
</a></li>
<li><a
href=
"ping"
>
ping
</a></li>
<li><a
href=
"hello.html"
>
serwlet Hello HTML
</a></li>
<li><a
href=
"hello.html"
>
serwlet Hello HTML
</a></li>
<li><a
href=
"rozmowa"
>
rozmowa
</a></li>
<li><a
href=
"rozmowa"
>
rozmowa
</a></li>
<li><a
href=
"kalkulator"
>
kalkulator
</a></li>
<li><a
href=
"przyklad.jsp"
>
przykład JSP
</a></li>
</ul>
</ul>
</body>
</body>
...
...
PC22-Serwlety/src/main/webapp/przyklad.jsp
0 → 100644
View file @
7b686088
<
%@
page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<
%@
page
import=
"java.time.LocalTime"
%
>
<
%@
page
import=
"java.util.concurrent.atomic.AtomicInteger"
%
>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
Przykład pliku JSP
</title>
</head>
<body>
<h1>
Przykład JSP
</h1>
<p>
To jest zwykły tekst
</p>
<
%
--
to
jest
komentarz
JSP
-
to
nie
zostanie
wys
ł
ane
do
klienta
--
%
>
<!-- to jest komentarz HTML - to ZOSTANIE wysłane do klienta -->
<
%
int
x =
100;
out
.
println
("
x
przed
zmian
ą
=
"
+
x
+
"<
br
>
");
x += 50;
out.println("x po zmianie = " + x + "
<br>
");
%>
<p>
Wartość zmiennej:
<
%=
x
%
></p>
<p>
Bieżący czas:
<
%=
LocalTime
.
now
()
%
></p>
<
%
--
skryptlet
typu
deklaracja
-
ten
kod
jest
umieszczany
na
poziomie
klasy
,
a
nie
wewn
ą
trz
metod
--
%
>
<
%!
private
final
AtomicInteger
licznik =
new
AtomicInteger
();
String
hello
()
{
return
"
Hello
hello
";
}
%
>
<p>
Wartość licznika
<
%=
licznik
.
incrementAndGet
()
%
>
<p>
Wywołanie
<
%=
hello
()
%
>
<h2>
Expression Language
</h2>
<p>
Wynik działania EL: ${2+3*4}
</p>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment