Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
javab_20230617
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
javab_20230617
Commits
9d34bc57
Commit
9d34bc57
authored
Jul 29, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
przeniesienie szablonów to WEB-INF
parent
d3568807
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
8 deletions
+7
-8
ProductController.java
...ing/src/main/java/sklep/controller/ProductController.java
+3
-4
RootController.java
...Spring/src/main/java/sklep/controller/RootController.java
+2
-2
index.jsp
PC27-SklepSpring/src/main/webapp/WEB-INF/templates/index.jsp
+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
show_time.jsp
...lepSpring/src/main/webapp/WEB-INF/templates/show_time.jsp
+1
-1
No files found.
PC27-SklepSpring/src/main/java/sklep/controller/ProductController.java
View file @
9d34bc57
...
...
@@ -7,7 +7,6 @@ import org.springframework.ui.Model;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
sklep.model.Product
;
import
java.util.List
;
...
...
@@ -23,7 +22,7 @@ public class ProductController {
public
String
readAll
(
Model
model
)
{
List
<
Product
>
products
=
em
.
createNamedQuery
(
"Product.findAll"
,
Product
.
class
).
getResultList
();
model
.
addAttribute
(
"products"
,
products
);
return
"/products.jsp"
;
return
"/
WEB-INF/templates/
products.jsp"
;
}
@GetMapping
(
"/{id}"
)
...
...
@@ -31,9 +30,9 @@ public class ProductController {
Product
product
=
em
.
find
(
Product
.
class
,
productId
);
if
(
product
!=
null
)
{
model
.
addAttribute
(
"product"
,
product
);
return
"/product.jsp"
;
return
"/
WEB-INF/templates/
product.jsp"
;
}
else
{
return
"/missing_product.jsp"
;
return
"/
WEB-INF/templates/
missing_product.jsp"
;
}
}
}
PC27-SklepSpring/src/main/java/sklep/controller/RootController.java
View file @
9d34bc57
...
...
@@ -11,7 +11,7 @@ import java.time.LocalDateTime;
public
class
RootController
{
@GetMapping
(
"/"
)
public
String
root
()
{
return
"index.jsp"
;
return
"
/WEB-INF/templates/
index.jsp"
;
}
@GetMapping
(
"/hello"
)
...
...
@@ -24,7 +24,7 @@ public class RootController {
public
String
currentTime
(
Model
model
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
model
.
addAttribute
(
"dt"
,
now
);
return
"show_time.jsp"
;
return
"
/WEB-INF/templates/
show_time.jsp"
;
}
}
PC27-SklepSpring/src/main/webapp/index.jsp
→
PC27-SklepSpring/src/main/webapp/
WEB-INF/templates/
index.jsp
View file @
9d34bc57
...
...
@@ -4,7 +4,7 @@
<head>
<meta
charset=
"UTF-8"
>
<title>
Aplikacja Sklep Spring
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styl.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
../../
styl.css"
>
</head>
<body>
<h1>
Spis treści
</h1>
...
...
PC27-SklepSpring/src/main/webapp/missing_product.jsp
→
PC27-SklepSpring/src/main/webapp/
WEB-INF/templates/
missing_product.jsp
View file @
9d34bc57
File moved
PC27-SklepSpring/src/main/webapp/product.jsp
→
PC27-SklepSpring/src/main/webapp/
WEB-INF/templates/
product.jsp
View file @
9d34bc57
File moved
PC27-SklepSpring/src/main/webapp/products.jsp
→
PC27-SklepSpring/src/main/webapp/
WEB-INF/templates/
products.jsp
View file @
9d34bc57
File moved
PC27-SklepSpring/src/main/webapp/show_time.jsp
→
PC27-SklepSpring/src/main/webapp/
WEB-INF/templates/
show_time.jsp
View file @
9d34bc57
...
...
@@ -3,7 +3,7 @@
<html>
<head>
<title>
Show time
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"styl.css"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
../../
styl.css"
>
</head>
<body>
<h1>
Bieżący czas
</h1>
...
...
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