Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20240528-BJava
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
20240528-BJava
Commits
8359ae3d
Commit
8359ae3d
authored
Jun 26, 2024
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rozmowa z formularzem
parent
f3072271
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
RozmowaController.java
...Spring/src/main/java/alx/aplikacja/RozmowaController.java
+18
-0
rozmowa.html
PC32-Spring/src/main/resources/templates/rozmowa.html
+21
-0
No files found.
PC32-Spring/src/main/java/alx/aplikacja/RozmowaController.java
0 → 100644
View file @
8359ae3d
package
alx
.
aplikacja
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
@Controller
public
class
RozmowaController
{
@GetMapping
(
"/rozmowa"
)
public
String
dzialaj
(
String
imie
,
Model
model
)
{
if
(
imie
!=
null
&&
!
imie
.
isEmpty
())
{
// System.out.println("otrzymałem imię: " + imie);
model
.
addAttribute
(
"wynik"
,
"Witaj "
+
imie
+
"!"
);
}
return
"rozmowa.html"
;
}
}
PC32-Spring/src/main/resources/templates/rozmowa.html
0 → 100644
View file @
8359ae3d
<!DOCTYPE html>
<html
lang=
"pl"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Rozmowa ze Springiem
</title>
<link
rel=
"stylesheet"
type=
"text/css"
th:href=
"@{/styl.css}"
href=
"../static/styl.css"
>
</head>
<body>
<h1>
Rozmowa ze Springiem
</h1>
<form>
<label
for=
"imie"
>
Jak masz na imię?
</label><br>
<input
id=
"imie"
name=
"imie"
type=
"text"
><br>
<button>
Wyślij
</button>
</form>
<div
class=
"wynik"
th:text=
"${wynik}"
th:if=
"${wynik}"
>
</div>
</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