Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SAE4.A02.1
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
Maxime Gosselin
SAE4.A02.1
Commits
3001d3fb
Commit
3001d3fb
authored
3 months ago
by
Maxime Gosselin
Browse files
Options
Downloads
Patches
Plain Diff
Fonction ne plus suivre un fil operationelle
parent
5060d1ad
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
WEB-INF/src/controleur/ThreadController.java
+20
-15
20 additions, 15 deletions
WEB-INF/src/controleur/ThreadController.java
WEB-INF/src/modele/dao/DaoFollower.java
+1
-1
1 addition, 1 deletion
WEB-INF/src/modele/dao/DaoFollower.java
WEB-INF/vue/filsSuivis.jsp
+1
-1
1 addition, 1 deletion
WEB-INF/vue/filsSuivis.jsp
with
22 additions
and
17 deletions
WEB-INF/src/controleur/ThreadController.java
+
20
−
15
View file @
3001d3fb
...
...
@@ -16,25 +16,30 @@ import java.io.IOException;
public
class
ThreadController
extends
HttpServlet
{
@Override
protected
void
service
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
String
action
=
(
String
)
req
.
getParameter
(
"action"
);
String
vue
;
String
username
;
DaoFollower
daoFollower
=
new
DaoFollower
();
// vérification de l'authentification
if
((
username
=
(
String
)
req
.
getSession
().
getAttribute
(
"username"
))
==
null
){
resp
.
sendRedirect
(
"index.html"
);
}
else
{
switch
(
action
){
case
"follow"
:
int
idThread
=
Integer
.
parseInt
(
req
.
getParameter
(
"id"
));
Follower
follow
=
new
Follower
(
username
,
idThread
);
daoFollower
.
create
(
follow
);
vue
=
"WEB-INF/vue/filsSuivis.jsp"
;
break
;
default
:
vue
=
"WEB-INF/vue/accueil.jsp"
;
}
req
.
getRequestDispatcher
(
vue
).
forward
(
req
,
resp
);
return
;
}
String
action
=
(
String
)
req
.
getParameter
(
"action"
);
String
vue
;
DaoFollower
daoFollower
=
new
DaoFollower
();
int
idThread
=
Integer
.
parseInt
(
req
.
getParameter
(
"id"
));
Follower
follow
=
new
Follower
(
username
,
idThread
);
switch
(
action
){
case
"follow"
:
daoFollower
.
create
(
follow
);
vue
=
"WEB-INF/vue/filsSuivis.jsp"
;
break
;
case
"unfollow"
:
daoFollower
.
delete
(
follow
);
vue
=
"WEB-INF/vue/filsSuivis.jsp"
;
break
;
default
:
vue
=
"WEB-INF/vue/fils.jsp"
;
}
req
.
getRequestDispatcher
(
vue
).
forward
(
req
,
resp
);
}
}
This diff is collapsed.
Click to expand it.
WEB-INF/src/modele/dao/DaoFollower.java
+
1
−
1
View file @
3001d3fb
...
...
@@ -44,7 +44,7 @@ public class DaoFollower {
public
void
delete
(
Follower
follower
)
{
DS
bdd
=
DS
.
getInstance
();
try
(
Connection
con
=
bdd
.
getConnection
())
{
PreparedStatement
ps
=
con
.
prepareStatement
(
"DELETE followers WHERE username=? AND id_thread=?"
);
PreparedStatement
ps
=
con
.
prepareStatement
(
"DELETE
FROM
followers WHERE username=? AND id_thread=?"
);
ps
.
setString
(
1
,
follower
.
getUsername
());
ps
.
setInt
(
2
,
follower
.
getId_thread
());
ps
.
executeUpdate
();
...
...
This diff is collapsed.
Click to expand it.
WEB-INF/vue/filsSuivis.jsp
+
1
−
1
View file @
3001d3fb
...
...
@@ -73,7 +73,7 @@
</div>
<div
class=
"d-flex"
>
<a
class=
"me-3 align-self-center btn btn-primary"
href=
"?chat=1"
>
Ouvrir
<i
class=
"bi-chat-fill"
></i></a>
<a
class=
"me-3 align-self-center btn btn-danger"
href=
"
?delete=1
"
>
Ne plus suivre
<i
class=
"bi-x-circle-fill"
></i></a>
<a
class=
"me-3 align-self-center btn btn-danger"
href=
"
thread?action=unfollow&id=
<%=
fil
.
getId_thread
()
%>
"
>
Ne plus suivre
<i
class=
"bi-x-circle-fill"
></i></a>
</div>
</div>
</div>
...
...
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