Commit 3c201afc by sikang

bug fix ,get params can be null

parent f25c2c99
...@@ -198,9 +198,10 @@ public class RequestHandler { ...@@ -198,9 +198,10 @@ public class RequestHandler {
if (url.split("\\?").length > 1) { if (url.split("\\?").length > 1) {
String paramsGET = url.split("\\?")[1]; String paramsGET = url.split("\\?")[1];
for (String param : paramsGET.split("&")) { for (String param : paramsGET.split("&")) {
if (param.split("=").length > 1) { String values[] = param.split("=");
String key = param.split("=")[0]; if (values.length > 0) {
String value = param.split("=")[1]; String key = values[0];
String value = values.length > 1 ? values[1] : "";
this.params.put(key, value); this.params.put(key, value);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment