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
0ddcd023
Commit
0ddcd023
authored
May 31, 2025
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Przeniesienie szablonów JSP do katalogu WEB-INF/templates
parent
89c7719c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
4 additions
and
4 deletions
+4
-4
ProductController.java
...ing/src/main/java/sklep/controller/ProductController.java
+3
-3
RootController.java
...Spring/src/main/java/sklep/controller/RootController.java
+1
-1
missing_product.jsp
...ing/src/main/webapp/WEB-INF/templates/missing_product.jsp
+0
-0
product.jsp
...SklepSpring/src/main/webapp/WEB-INF/templates/product.jsp
+0
-0
products.jsp
...klepSpring/src/main/webapp/WEB-INF/templates/products.jsp
+0
-0
spis_tresci.jsp
...pSpring/src/main/webapp/WEB-INF/templates/spis_tresci.jsp
+0
-0
No files found.
PC37-SklepSpring/src/main/java/sklep/controller/ProductController.java
View file @
0ddcd023
...
@@ -22,7 +22,7 @@ public class ProductController {
...
@@ -22,7 +22,7 @@ public class ProductController {
public
String
getProducts
(
Model
model
)
{
public
String
getProducts
(
Model
model
)
{
List
<
Product
>
products
=
productRepository
.
findAll
();
List
<
Product
>
products
=
productRepository
.
findAll
();
model
.
addAttribute
(
"products"
,
products
);
model
.
addAttribute
(
"products"
,
products
);
return
"products.jsp"
;
return
"
/WEB-INF/templates/
products.jsp"
;
}
}
@GetMapping
(
path
=
"/products/{id}"
,
produces
=
"text/html"
)
@GetMapping
(
path
=
"/products/{id}"
,
produces
=
"text/html"
)
...
@@ -30,9 +30,9 @@ public class ProductController {
...
@@ -30,9 +30,9 @@ public class ProductController {
Optional
<
Product
>
optProduct
=
productRepository
.
findById
(
id
);
Optional
<
Product
>
optProduct
=
productRepository
.
findById
(
id
);
if
(
optProduct
.
isPresent
())
{
if
(
optProduct
.
isPresent
())
{
model
.
addAttribute
(
"product"
,
optProduct
.
get
());
model
.
addAttribute
(
"product"
,
optProduct
.
get
());
return
"/product.jsp"
;
return
"/
WEB-INF/templates/
product.jsp"
;
}
else
{
}
else
{
return
"/missing_product.jsp"
;
return
"/
WEB-INF/templates/
missing_product.jsp"
;
}
}
}
}
...
...
PC37-SklepSpring/src/main/java/sklep/controller/RootController.java
View file @
0ddcd023
...
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
public
class
RootController
{
public
class
RootController
{
@GetMapping
(
"/"
)
@GetMapping
(
"/"
)
public
String
index
()
{
public
String
index
()
{
return
"spis_tresci.jsp"
;
return
"
/WEB-INF/templates/
spis_tresci.jsp"
;
}
}
@GetMapping
(
"/hello"
)
@GetMapping
(
"/hello"
)
...
...
PC37-SklepSpring/src/main/webapp/missing_product.jsp
→
PC37-SklepSpring/src/main/webapp/
WEB-INF/templates/
missing_product.jsp
View file @
0ddcd023
File moved
PC37-SklepSpring/src/main/webapp/product.jsp
→
PC37-SklepSpring/src/main/webapp/
WEB-INF/templates/
product.jsp
View file @
0ddcd023
File moved
PC37-SklepSpring/src/main/webapp/products.jsp
→
PC37-SklepSpring/src/main/webapp/
WEB-INF/templates/
products.jsp
View file @
0ddcd023
File moved
PC37-SklepSpring/src/main/webapp/spis_tresci.jsp
→
PC37-SklepSpring/src/main/webapp/
WEB-INF/templates/
spis_tresci.jsp
View file @
0ddcd023
File moved
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