Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alx_mszczonow_3
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_mszczonow_3
Commits
ab9ee12b
Commit
ab9ee12b
authored
Jul 25, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time5 - zrobione
parent
f40ef742
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
TimeController.java
src/main/java/alx/TimeController.java
+3
-1
szablon5.html
src/main/resources/templates/szablon5.html
+7
-0
No files found.
src/main/java/alx/TimeController.java
View file @
ab9ee12b
package
alx
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
...
...
@@ -53,8 +54,9 @@ public class TimeController {
}
@RequestMapping
(
"/time5"
)
public
String
time5
()
{
public
String
time5
(
Model
model
)
{
LocalDateTime
dateTime
=
LocalDateTime
.
now
();
model
.
addAttribute
(
"dt"
,
dateTime
);
return
"szablon5.html"
;
}
...
...
src/main/resources/templates/szablon5.html
View file @
ab9ee12b
...
...
@@ -7,6 +7,12 @@
<body>
<h1>
Szablon 5
</h1>
<p>
Zaraz powiem, która godzina...
</p>
<p>
Bieżący czas: [[${dt}]]
</p>
<ul>
<li>
Rok: [[${dt.year}]]
</li>
<li>
Dzień roku: [[${dt.dayOfYear}]]
</li>
<li>
Dzień tygodnia: [[${dt.dayOfWeek}]]
</li>
</ul>
</body>
</html>
\ No newline at end of file
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