Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java_dzienna_15_09
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
java_dzienna_15_09
Commits
9fb49957
Commit
9fb49957
authored
Oct 04, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
product.jsp
parent
363e9371
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
AlternatywneProdukty2.java
...src/main/java/sklep/controller/AlternatywneProdukty2.java
+2
-2
product.jsp
PC30-SklepSpring/src/main/webapp/product.jsp
+24
-0
No files found.
PC30-SklepSpring/src/main/java/sklep/controller/AlternatywneProdukty2.java
View file @
9fb49957
...
@@ -31,8 +31,8 @@ public class AlternatywneProdukty2 {
...
@@ -31,8 +31,8 @@ public class AlternatywneProdukty2 {
@GetMapping
(
"/products/{id}"
)
@GetMapping
(
"/products/{id}"
)
public
String
oneProduct
(
Model
model
,
@PathVariable
int
id
)
{
public
String
oneProduct
(
Model
model
,
@PathVariable
int
id
)
{
Product
product
=
em
.
find
(
Product
.
class
,
id
);
Product
product
=
em
.
find
(
Product
.
class
,
id
);
model
.
addAttribute
(
"product
s"
,
List
.
of
(
product
)
);
model
.
addAttribute
(
"product
"
,
product
);
return
"/product
s
.jsp"
;
return
"/product.jsp"
;
}
}
}
}
PC30-SklepSpring/src/main/webapp/product.jsp
0 → 100644
View file @
9fb49957
<
%@
page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
${product.productName}
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/styl.css"
/>
</head>
<body>
<h1>
Informacje o produkcie ${product.productId}
</h1>
<div
class=
"product"
>
<p>
Towar
<a
href=
"/products/${product.productId}"
class=
"product-name"
>
${product.productName}
</a></p>
<p>
Cena:
<span
class=
"product-price"
>
${product.price}
</span></p>
<p>
Stawka VAT:
<span
class=
"product-price"
>
${product.vat * 100}%
</span></p>
<p
class=
"product-description"
>
${product.description}
</p>
</div>
<p><a
href=
"/products"
>
Przejdź do listy produktów
</a></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