parent
f60cce5ba7
commit
90f658464e
6 changed files with 83 additions and 66 deletions
@ -1 +1 @@ |
||||
trigger_log_url=http://localhost:8080/xxl-job-admin/joblog/save |
||||
trigger_log_url=http://localhost:8080/joblog/save |
@ -1,60 +1,60 @@ |
||||
package com.xxl.job.client.netcom.http; |
||||
|
||||
|
||||
import java.io.IOException; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import javax.servlet.ServletException; |
||||
import javax.servlet.http.HttpServlet; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
import com.xxl.job.client.handler.HandlerRepository; |
||||
|
||||
|
||||
/** |
||||
* remote job client on http |
||||
* @author xuxueli 2015-12-19 18:36:47 |
||||
*/ |
||||
public class XxlJobServlet extends HttpServlet { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* Default constructor. |
||||
*/ |
||||
public XxlJobServlet() { |
||||
// TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
/** |
||||
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) |
||||
*/ |
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
||||
request.setCharacterEncoding("UTF-8"); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
|
||||
Map<String, String> _param = new HashMap<String, String>(); |
||||
if (request.getParameterMap()!=null && request.getParameterMap().size()>0) { |
||||
for (Object paramKey : request.getParameterMap().keySet()) { |
||||
if (paramKey!=null) { |
||||
String paramKeyStr = paramKey.toString(); |
||||
_param.put(paramKeyStr, request.getParameter(paramKeyStr)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
String resp = HandlerRepository.pushHandleQueue(_param); |
||||
response.getWriter().append(resp); |
||||
return; |
||||
} |
||||
|
||||
/** |
||||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) |
||||
*/ |
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
||||
// TODO Auto-generated method stub
|
||||
doGet(request, response); |
||||
} |
||||
|
||||
} |
||||
package com.xxl.job.client.netcom.servlet; |
||||
|
||||
|
||||
import java.io.IOException; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import javax.servlet.ServletException; |
||||
import javax.servlet.http.HttpServlet; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
import com.xxl.job.client.handler.HandlerRepository; |
||||
|
||||
|
||||
/** |
||||
* remote job client on http |
||||
* @author xuxueli 2015-12-19 18:36:47 |
||||
*/ |
||||
public class XxlJobServlet extends HttpServlet { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* Default constructor. |
||||
*/ |
||||
public XxlJobServlet() { |
||||
// TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
/** |
||||
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) |
||||
*/ |
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
||||
request.setCharacterEncoding("UTF-8"); |
||||
response.setCharacterEncoding("UTF-8"); |
||||
|
||||
Map<String, String> _param = new HashMap<String, String>(); |
||||
if (request.getParameterMap()!=null && request.getParameterMap().size()>0) { |
||||
for (Object paramKey : request.getParameterMap().keySet()) { |
||||
if (paramKey!=null) { |
||||
String paramKeyStr = paramKey.toString(); |
||||
_param.put(paramKeyStr, request.getParameter(paramKeyStr)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
String resp = HandlerRepository.pushHandleQueue(_param); |
||||
response.getWriter().append(resp); |
||||
return; |
||||
} |
||||
|
||||
/** |
||||
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) |
||||
*/ |
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
||||
// TODO Auto-generated method stub
|
||||
doGet(request, response); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue