Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Matúš Valko
Online Gaming Management System
Commits
4115ff44
Commit
4115ff44
authored
May 20, 2022
by
Dominik Kozubík
Browse files
add required param
parent
32d85361
Pipeline
#141722
passed with stage
in 1 minute and 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gaming-spring-mvc/src/main/java/cz/muni/fi/pa165/mvc/controllers/MatchController.java
View file @
4115ff44
...
...
@@ -82,10 +82,13 @@ public class MatchController {
Model
model
,
RedirectAttributes
redirectAttributes
,
UriComponentsBuilder
uriBuilder
)
{
//in case of validation error forward back to the the form
if
(
bindingResult
.
hasErrors
())
{
System
.
err
.
println
(
"tu som 0"
);
return
"match/new"
;
}
//create tournament
System
.
err
.
println
(
"tu som 1"
);
String
uuid
=
matchFacade
.
createMatch
(
formBean
);
System
.
err
.
println
(
"tu som 2"
);
//report success
redirectAttributes
.
addFlashAttribute
(
"alert_success"
,
"Match "
+
uuid
+
" was created"
);
return
"redirect:"
+
uriBuilder
.
path
(
"/match/view/{id}"
).
buildAndExpand
(
uuid
).
encode
().
toUriString
();
...
...
gaming-spring-mvc/src/main/webapp/WEB-INF/jsp/match/new.jsp
View file @
4115ff44
...
...
@@ -13,7 +13,7 @@
<div
class=
"form-group"
>
<form:label
path=
"tournament"
cssClass=
"col-sm-2 control-label"
>
Tournament
</form:label>
<div
class=
"col-sm-10"
>
<form:select
path=
"tournament"
cssClass=
"form-control"
>
<form:select
path=
"tournament"
required=
"required"
cssClass=
"form-control"
>
<c:forEach
items=
"
${
tournaments
}
"
var=
"tournament"
>
<form:option
value=
"
${
tournament
.
id
}
"
>
${tournament.id}
</form:option>
</c:forEach>
...
...
@@ -24,7 +24,7 @@
<div
class=
"form-group"
>
<form:label
path=
"teams"
cssClass=
"col-sm-2 control-label"
>
Team
</form:label>
<div
class=
"col-sm-10"
>
<form:select
path=
"teams"
cssClass=
"form-control"
>
<form:select
path=
"teams"
required=
"required"
cssClass=
"form-control"
>
<c:forEach
items=
"
${
teams
}
"
var=
"team"
>
<form:option
value=
"
${
team
.
name
}
"
>
${team.name}
</form:option>
</c:forEach>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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