-
Notifications
You must be signed in to change notification settings - Fork 0
/
JobController.java
30 lines (22 loc) · 948 Bytes
/
JobController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.CodingDojo.LognadReg.Controllers;
import javax.servlet.http.HttpSession;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import com.CodingDojo.LognadReg.Models.User;
import com.CodingDojo.LognadReg.Service.UserService;
import com.CodingDojo.LognadReg.Validator.UserValidator;
public class JobController {
private final UserService userService;
private final UserValidator userValidator;
public JobController(UserService userService, UserValidator userValidator) {
this.userService = userService;
this.userValidator = userValidator;
}
@GetMapping("/dashboard")
public String dash(Model model, HttpSession session) {
Long id = (Long)session.getAttribute("userid");
User loggedinuser = this.userService.findUserById(id);
model.addAttribute("loggedinuser", loggedinuser);
return "/LognadReg/dashboard.jsp";
}
}