This commit is contained in:
Redkale
2016-09-06 08:37:00 +08:00
parent e546ff74a5
commit de4dda7c73
2 changed files with 12 additions and 1 deletions

View File

@@ -42,7 +42,14 @@ public class RestDocs extends HttpBaseServlet {
continue;
}
final Map<String, Object> servletmap = new LinkedHashMap<>();
servletmap.put("mappings", ws.value());
String prefix = _prefix(servlet);
String[] mappings = ws.value();
if (prefix != null && !prefix.isEmpty()) {
for (int i = 0; i < mappings.length; i++) {
mappings[i] = prefix + mappings[i];
}
}
servletmap.put("mappings", mappings);
servletmap.put("moduleid", ws.moduleid());
servletmap.put("name", ws.name());
servletmap.put("comment", ws.comment());

View File

@@ -192,6 +192,10 @@ public abstract class HttpBaseServlet extends HttpServlet {
public abstract boolean authenticate(int module, int actionid, HttpRequest request, HttpResponse response) throws IOException;
protected String _prefix(HttpServlet servlet) {
return servlet._prefix;
}
private HashMap<String, Entry> load() {
final boolean typeIgnore = this.getClass().getAnnotation(AuthIgnore.class) != null;
WebServlet module = this.getClass().getAnnotation(WebServlet.class);