// Check Token is Valid or Not
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException
{
// Header Key Muse be = "Authorization"
String authorization = httpServletRequest.getHeader("Authorization");
String token = null;
String userName = null;
// Check Header Value start with "Bearer "
if(null != authorization && authorization.startsWith("Bearer "))
{
token = authorization.substring(7);
userName = jwtUtility.getUsernameFromToken(token);
}
@PostMapping("/flight/book/verify")
public String showVerifyBookingPageResult(@RequestParam("flightId") long flightId,
@RequestParam("passengerId") long passengerId,
Model model)
{
Flight flight = flightService.getFlightById(flightId);
}
public class TestController
{
private final ServerServiceImpl serverService;
@PostMapping("/save")
public ResponseEntity<Response> saveServer(@RequestBody @Valid Server server)
{
serverService.create(server));
}
}