1
2
3
4
5
6
7
8
9
10
11 package psiprobe.controllers.jsp;
12
13 import jakarta.servlet.http.HttpServletRequest;
14 import jakarta.servlet.http.HttpServletResponse;
15
16 import org.apache.catalina.Context;
17 import org.springframework.beans.factory.annotation.Value;
18 import org.springframework.stereotype.Controller;
19 import org.springframework.web.bind.annotation.RequestMapping;
20 import org.springframework.web.servlet.ModelAndView;
21 import org.springframework.web.servlet.view.RedirectView;
22
23 import psiprobe.controllers.AbstractContextHandlerController;
24
25
26
27
28 @Controller
29 public class DiscardCompiledJspController extends AbstractContextHandlerController {
30
31 @RequestMapping(path = "/adm/discard.htm")
32 @Override
33 public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
34 throws Exception {
35 return super.handleRequest(request, response);
36 }
37
38 @Override
39 protected ModelAndView handleContext(String contextName, Context context,
40 HttpServletRequest request, HttpServletResponse response) throws Exception {
41
42 getContainerWrapper().getTomcatContainer().discardWorkDir(context);
43 return new ModelAndView(new RedirectView(
44 request.getContextPath() + getViewName() + "?" + request.getQueryString()));
45 }
46
47 @Value("/app/jsp.htm")
48 @Override
49 public void setViewName(String viewName) {
50 super.setViewName(viewName);
51 }
52
53 }