diff --git a/xxl-job-admin/src/main/java/com/xxl/job/service/job/RemoteHttpJobBean.java b/xxl-job-admin/src/main/java/com/xxl/job/service/job/RemoteHttpJobBean.java
index 7b071317..7ca28fcf 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/service/job/RemoteHttpJobBean.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/service/job/RemoteHttpJobBean.java
@@ -58,10 +58,16 @@ public class RemoteHttpJobBean extends QuartzJobBean {
params.put(HandlerRepository.TRIGGER_LOG_ID, String.valueOf(jobLog.getId()));
params.put(HandlerRepository.HANDLER_NAME, jobDataMap.get(HandlerRepository.HANDLER_NAME));
params.put(HandlerRepository.HANDLER_PARAMS, jobDataMap.get(HandlerRepository.HANDLER_PARAMS));
-
- String[] postResp = HttpUtil.post(jobDataMap.get(HandlerRepository.HANDLER_ADDRESS), params);
+
+ // handler address, netty or servlet
+ String handler_address = jobDataMap.get(HandlerRepository.HANDLER_ADDRESS);
+ if (!handler_address.startsWith("http")){
+ handler_address = "http://" + handler_address + "/";
+ }
+
+ String[] postResp = HttpUtil.post(handler_address, params);
logger.info(">>>>>>>>>>> xxl-job trigger http response, jobLog.id:{}, jobLog:{}", jobLog.getId(), jobLog);
-
+
// parse trigger response
String responseMsg = postResp[0];
String exceptionMsg = postResp[1];
diff --git a/xxl-job-admin/src/main/resources/config.properties b/xxl-job-admin/src/main/resources/config.properties
index 606ed642..c22c950d 100644
--- a/xxl-job-admin/src/main/resources/config.properties
+++ b/xxl-job-admin/src/main/resources/config.properties
@@ -1 +1 @@
-trigger_log_url=http://localhost:8080/xxl-job-admin/joblog/save
\ No newline at end of file
+trigger_log_url=http://localhost:8080/joblog/save
\ No newline at end of file
diff --git a/xxl-job-client-demo/src/main/resources/applicationcontext-base.xml b/xxl-job-client-demo/src/main/resources/applicationcontext-base.xml
index 047d065c..52e9cdc3 100644
--- a/xxl-job-client-demo/src/main/resources/applicationcontext-base.xml
+++ b/xxl-job-client-demo/src/main/resources/applicationcontext-base.xml
@@ -11,4 +11,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/xxl-job-client-demo/src/main/webapp/WEB-INF/web.xml b/xxl-job-client-demo/src/main/webapp/WEB-INF/web.xml
index 49d0a282..33ab3dac 100644
--- a/xxl-job-client-demo/src/main/webapp/WEB-INF/web.xml
+++ b/xxl-job-client-demo/src/main/webapp/WEB-INF/web.xml
@@ -23,7 +23,7 @@
XxlJobServlet
- com.xxl.job.client.netcom.http.XxlJobServlet
+ com.xxl.job.client.netcom.servlet.XxlJobServlet
1
diff --git a/xxl-job-client/pom.xml b/xxl-job-client/pom.xml
index aec6ec97..7b0a656d 100644
--- a/xxl-job-client/pom.xml
+++ b/xxl-job-client/pom.xml
@@ -24,6 +24,13 @@
2.1
provided
+
+
+
+ org.eclipse.jetty
+ jetty-server
+ 7.6.9.v20130131
+
@@ -45,7 +52,7 @@
httpclient
4.3.6
-
+
diff --git a/xxl-job-client/src/main/java/com/xxl/job/client/netcom/http/XxlJobServlet.java b/xxl-job-client/src/main/java/com/xxl/job/client/netcom/servlet/XxlJobServlet.java
similarity index 94%
rename from xxl-job-client/src/main/java/com/xxl/job/client/netcom/http/XxlJobServlet.java
rename to xxl-job-client/src/main/java/com/xxl/job/client/netcom/servlet/XxlJobServlet.java
index fc2e4b3b..4ea7264c 100644
--- a/xxl-job-client/src/main/java/com/xxl/job/client/netcom/http/XxlJobServlet.java
+++ b/xxl-job-client/src/main/java/com/xxl/job/client/netcom/servlet/XxlJobServlet.java
@@ -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 _param = new HashMap();
- 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 _param = new HashMap();
+ 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);
+ }
+
+}