Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
java_weekendowa_20221008
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_weekendowa_20221008
Commits
0f9ff0c1
Commit
0f9ff0c1
authored
Nov 26, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wypisywanie błędów SQL w razie wystąpienia
parent
2adddba3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
ProductController.java
...ing/src/main/java/sklep/controller/ProductController.java
+6
-2
styl.css
PC30-SklepSpring/src/main/webapp/styl.css
+2
-2
No files found.
PC30-SklepSpring/src/main/java/sklep/controller/ProductController.java
View file @
0f9ff0c1
...
@@ -90,8 +90,12 @@ public class ProductController {
...
@@ -90,8 +90,12 @@ public class ProductController {
// Spring sam wpisze dane do pól o takich samych nazwach.
// Spring sam wpisze dane do pól o takich samych nazwach.
// Taki parametr od razu staje się częścią modelu (to jest tzw. ModelAttribute)
// Taki parametr od razu staje się częścią modelu (to jest tzw. ModelAttribute)
// i nie trzeba dodawać go w osobnym poleceniu.
// i nie trzeba dodawać go w osobnym poleceniu.
try
{
productRepository
.
save
(
product
);
productRepository
.
save
(
product
);
model
.
addAttribute
(
"saved"
,
true
);
}
catch
(
Exception
e
)
{
model
.
addAttribute
(
"errors"
,
List
.
of
(
e
.
toString
()));
}
return
"product_form"
;
return
"product_form"
;
}
}
...
...
PC30-SklepSpring/src/main/webapp/styl.css
View file @
0f9ff0c1
...
@@ -46,7 +46,7 @@ h2, h3, h4 {
...
@@ -46,7 +46,7 @@ h2, h3, h4 {
.error
{
.error
{
color
:
red
;
color
:
red
;
border
:
4px
solid
red
;
border
:
4px
solid
red
;
margin
:
1em
0
;
margin
:
1em
400px
1em
50px
;
padding
:
1em
;
padding
:
1em
;
background-color
:
white
;
background-color
:
white
;
font-weight
:
bold
;
font-weight
:
bold
;
...
@@ -55,7 +55,7 @@ h2, h3, h4 {
...
@@ -55,7 +55,7 @@ h2, h3, h4 {
.info
{
.info
{
color
:
green
;
color
:
green
;
border
:
4px
solid
green
;
border
:
4px
solid
green
;
margin
:
1em
0
;
margin
:
1em
400px
1em
50px
;
padding
:
1em
;
padding
:
1em
;
background-color
:
white
;
background-color
:
white
;
font-weight
:
bold
;
font-weight
:
bold
;
...
...
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