Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationGommette
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boris OUYA
ApplicationGommette
Commits
5cab8cf4
Commit
5cab8cf4
authored
2 years ago
by
Boris
Browse files
Options
Downloads
Patches
Plain Diff
Logout
parent
45165d1e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/com/uca/StartServer.java
+9
-1
9 additions, 1 deletion
src/com/uca/StartServer.java
src/main/resources/views/welcome.ftl
+6
-0
6 additions, 0 deletions
src/main/resources/views/welcome.ftl
with
15 additions
and
1 deletion
src/com/uca/StartServer.java
+
9
−
1
View file @
5cab8cf4
...
...
@@ -40,6 +40,8 @@ public class StartServer {
{
System
.
out
.
println
(
"http://localhost:"
+
portNb
+
"/"
+
suffix
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
int
portNb
=
8081
;
...
...
@@ -92,6 +94,13 @@ public class StartServer {
return
null
;
});
post
(
"/logout"
,
(
req
,
res
)
->
{
res
.
removeCookie
(
"session-id"
);
res
.
redirect
(
"/login"
);
return
null
;
});
displayLocalHost
(
portNb
,
"login"
);
get
(
"/login"
,(
req
,
res
)->{
...
...
@@ -113,7 +122,6 @@ public class StartServer {
res
.
cookie
(
"session-id"
,
id
);
res
.
redirect
(
"/welcome"
);
return
null
;
}
return
"<!DOCTYPE html><html>Incorrect<a href=\'/login\'>Reessayer</a></html>"
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/views/welcome.ftl
+
6
−
0
View file @
5cab8cf4
...
...
@@ -12,6 +12,12 @@
<
a
href="/eleves" >Liste des eleves</a>
<
a
href="/gommettes">Liste des gommettes</a>
<
form
method="post" action="/logout">
<input type="hidden" name="id" value="$
{
prof
.id
}
">
<button type="submit">Se déconnecter</button>
</
form
>
</
body
>
</
html
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment