This commit is contained in:
Redkale
2016-09-26 09:23:35 +08:00
parent b365b18be0
commit fa601c69e7
2 changed files with 5 additions and 3 deletions

View File

@@ -22,7 +22,7 @@
var createhtml = function (jsoncontent) { var createhtml = function (jsoncontent) {
var classmap = jsoncontent.types; var classmap = jsoncontent.types;
var html = []; var html = [];
html.push('<div style="width:' + Math.floor(window.screen.width * 0.8) + 'px;margin:0 auto;text-align: center;">'); html.push('<div style="width:' + Math.floor(window.screen.width * 0.9) + 'px;margin:0 auto;text-align: center;">');
html.push('<br/><br/><table class="table" align="center">'); html.push('<br/><br/><table class="table" align="center">');
for (var i = 0; i < jsoncontent.servers.length; i++) { for (var i = 0; i < jsoncontent.servers.length; i++) {
for (var j = 0; j < jsoncontent.servers[i].servlets.length; j++) { for (var j = 0; j < jsoncontent.servers[i].servlets.length; j++) {
@@ -45,12 +45,12 @@
t = '<a href="#' + param.type.replace('[]', '') + '">' + t + '</a>'; t = '<a href="#' + param.type.replace('[]', '') + '">' + t + '</a>';
} }
if (param.name == '&') { if (param.name == '&') {
paramshtml.push('<tr><td>user </td><td> ' + t + '</td><td> 当前用户</td></tr>'); paramshtml.push('<tr><td style="font-size:12px;">内置 </td><td> ' + t + '</td><td> 当前用户</td></tr>');
} else { } else {
var c = ' style="font-weight:bold;"'; var c = ' style="font-weight:bold;"';
if (param.src == "HEADER") c = ' style="color:red;font-weight:bold;"'; if (param.src == "HEADER") c = ' style="color:red;font-weight:bold;"';
if (param.src == "COOKIE") c = ' style="color:blue;font-weight:bold;"'; if (param.src == "COOKIE") c = ' style="color:blue;font-weight:bold;"';
paramshtml.push('<tr><td ' + c + '>' + param.name + ' </td><td> ' + t + '</td><td> ' + param.comment + '</td></tr>'); paramshtml.push('<tr><td ' + c + '> ' + param.name + ' </td><td> ' + t + '</td><td> ' + param.comment + '</td></tr>');
} }
} }
paramshtml.push('</table>'); paramshtml.push('</table>');

View File

@@ -50,6 +50,7 @@ public final class HttpServer extends Server<String, HttpContext, HttpRequest, H
RestHttpServlet servlet = null; RestHttpServlet servlet = null;
for (final HttpServlet item : ((HttpPrepareServlet) this.prepare).getServlets()) { for (final HttpServlet item : ((HttpPrepareServlet) this.prepare).getServlets()) {
if (!(item instanceof RestHttpServlet)) continue; if (!(item instanceof RestHttpServlet)) continue;
if (item.getClass().getAnnotation(Rest.RestDynamic.class) == null) continue;
try { try {
Field field = item.getClass().getDeclaredField(Rest.REST_SERVICE_FIELD_NAME); Field field = item.getClass().getDeclaredField(Rest.REST_SERVICE_FIELD_NAME);
if (serviceType.equals(field.getType())) { if (serviceType.equals(field.getType())) {
@@ -57,6 +58,7 @@ public final class HttpServer extends Server<String, HttpContext, HttpRequest, H
break; break;
} }
} catch (NoSuchFieldException | SecurityException e) { } catch (NoSuchFieldException | SecurityException e) {
System.err.println("serviceType = " + serviceType + ", servletClass = " + item.getClass());
e.printStackTrace(); e.printStackTrace();
} }
} }