1
2
3
4
5
6
7
8
9
10
11 package psiprobe.controllers.logs;
12
13 import jakarta.servlet.http.HttpServletRequest;
14 import jakarta.servlet.http.HttpServletResponse;
15
16 import java.io.File;
17 import java.util.List;
18
19 import org.springframework.beans.factory.annotation.Value;
20 import org.springframework.stereotype.Controller;
21 import org.springframework.web.bind.annotation.RequestMapping;
22 import org.springframework.web.servlet.ModelAndView;
23
24 import psiprobe.tools.logging.LogDestination;
25
26
27
28
29 @Controller
30 public class SetupFollowController extends AbstractLogHandlerController {
31
32 @RequestMapping(path = "/follow.htm")
33 @Override
34 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
35 throws Exception {
36 return super.handleRequest(request, response);
37 }
38
39 @Override
40 protected ModelAndView handleLogFile(HttpServletRequest request, HttpServletResponse response,
41 LogDestination logDest) throws Exception {
42
43 File logFile = logDest.getFile();
44 List<LogDestination> sources = getLogResolver().getLogSources(logFile);
45 return new ModelAndView(getViewName()).addObject("log", logDest).addObject("sources", sources);
46 }
47
48 @Value("follow")
49 @Override
50 public void setViewName(String viewName) {
51 super.setViewName(viewName);
52 }
53
54 }