codeEditAction.jsp
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="com.weaver.formmodel.util.StringHelper"%>
<%@ include file="/formmode/checkright4setting.jsp" %>
<%@ page import="weaver.general.GCONST"%>
<%@ page import="com.weaver.formmodel.util.FileHelper"%>
<%@ page import="com.weaver.formmodel.util.DynamicCompiler"%>
<%@ page import="java.io.File"%>
<%@ page import="java.net.URLEncoder"%>
<%@ page import="weaver.formmode.service.CommonConstant"%>
<%@ page import="java.net.URLDecoder"%>
<%@ page import="weaver.formmode.customjavacode.JavaCodeManager"%>
<%@ include file="/formmode/pub_init.jsp"%>
<%@page import="net.sf.json.JSONObject"%>
<%
if (!HrmUserVarify.checkUserRight("ModeSetting:All", user)&&!HrmUserVarify.checkUserRight("FORMMODEAPP:ALL", user)) {
response.sendRedirect("/notice/noright.jsp");
return;
}
response.reset();
out.clear();
String action = Util.null2String(request.getParameter("action"));
if(action.equalsIgnoreCase("saveCode")){
}else if(action.equalsIgnoreCase("checkFileAddress")){
String javafileAddress = Util.null2String(request.getParameter("javafileAddress"));
JSONObject result = new JSONObject();
result.put("status","0");
String filepath = this.getClass().getResource("/").getPath()+javafileAddress.replaceAll("\\.","\\/").replaceAll("\\/java","").replaceAll("\\/class","")+".class";
File file = new File(filepath);
if (file.exists()) {
result.put("status","1");
}
response.setCharacterEncoding("UTF-8");
out.print(result.toString());
}
out.flush();
out.close();
%>