17 lines
564 B
Java
17 lines
564 B
Java
package com.example.controller;
|
|
|
|
import org.springframework.messaging.handler.annotation.MessageMapping;
|
|
import org.springframework.messaging.handler.annotation.SendTo;
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
@Controller
|
|
public class SessionTimeoutController {
|
|
|
|
@MessageMapping("/check-inactivity")
|
|
@SendTo("/topic/session-timeout")
|
|
public String checkInactivity(String userId) {
|
|
// Logic to check inactivity (e.g., based on userId)
|
|
return "Session timed out due to inactivity. Please log in again.";
|
|
}
|
|
}
|