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
5c9f4b1f
Commit
5c9f4b1f
authored
May 31, 2025
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pokaż czas
parent
dfb125f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
RootController.java
...Spring/src/main/java/sklep/controller/RootController.java
+9
-0
wyswietl_czas.jsp
...pring/src/main/webapp/WEB-INF/templates/wyswietl_czas.jsp
+11
-0
No files found.
PC37-SklepSpring/src/main/java/sklep/controller/RootController.java
View file @
5c9f4b1f
package
sklep
.
controller
;
import
java.time.LocalDateTime
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -16,4 +19,10 @@ public class RootController {
public
String
hello
()
{
return
"Hello Spring!"
;
}
@GetMapping
(
"/czas"
)
public
String
odczytajCzasJsp
(
Model
model
)
{
model
.
addAttribute
(
"dt"
,
LocalDateTime
.
now
());
return
"wyswietl_czas"
;
}
}
PC37-SklepSpring/src/main/webapp/WEB-INF/templates/wyswietl_czas.jsp
0 → 100644
View file @
5c9f4b1f
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<html>
<head>
<title>
Która godzina
</title>
</head>
<body>
<h1>
Wyświetlanie czasu
</h1>
<p>
Teraz jest:
<strong>
${dt}
</strong></p>
<p>
Do 17 brakuje ${17 - dt.hour} godzin.
</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