use of org.axe.annotation.mvc.Request in project Axe by DongyuCai.
the class TestController method postPathParam2.
@Request(value = "/post100/4{id}_{name}", method = RequestMethod.POST)
public Data postPathParam2(@RequestParam("id") String id, Param param) {
System.out.println("postPathParam2");
Data data = analysisParam(param);
return data;
}
use of org.axe.annotation.mvc.Request in project Axe by DongyuCai.
the class TestController method forward.
@Request(value = "/forward", method = RequestMethod.GET)
public View forward() {
//浏览器端跳转
View v = new View("someOneElse");
v.addModel("arg1", "val1");
return v;
}
use of org.axe.annotation.mvc.Request in project Axe by DongyuCai.
the class HomeController method tns.
@Request(value = "/tns", method = RequestMethod.GET)
public void tns(@RequestParam("token") String token, HttpServletRequest request, HttpServletResponse response) {
String contextPath = request.getContextPath();
StringBuilder html = new StringBuilder();
html.append("<!DOCTYPE html>");
html.append("<html>");
html.append("<head>");
html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />");
html.append("<title>axe tns</title>");
html.append("</head>");
html.append("<body>");
html.append("<table width=\"100%\">");
html.append("<tr><td align=\"right\">");
if (ConfigHelper.getAxeSignIn()) {
html.append("<a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe/sign-out?token=" + token + "\"><b>退出</b></a>");
}
html.append(" <a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe?token=" + token + "\"><b>首页</b></a>");
html.append("</td></tr>");
Set<Class<?>> serviceClassSet = ClassHelper.getClassSetByAnnotation(Service.class);
List<Method> tnsMethods = new ArrayList<>();
for (Class<?> serviceClass : serviceClassSet) {
List<Method> methods = ReflectionUtil.getMethodByAnnotation(serviceClass, Tns.class);
if (CollectionUtil.isNotEmpty(methods)) {
tnsMethods.addAll(methods);
}
}
html.append("<tr><td align=\"center\"><font size=\"28\">Tns point x" + tnsMethods.size() + "</font></td></tr>");
html.append("");
html.append("<tr><td><table cellspacing=\"0px\"><tr><td style=\"background-color: #AE0000\">");
html.append(" <font color=\"white\"><b>Tns point</b></font> ");
html.append("</td></tr></table></td></tr>");
html.append("");
html.append("<tr><td height=\"2px\" style=\"background-color: #AE0000\"></td></tr>");
html.append("<tr><td>");
html.append("<table width=\"100%\">");
html.append("<tr style=\"background-color: #F0F0F0;\">");
html.append("<td align=\"left\"> </td>");
html.append("<td align=\"left\"><b>Method</b></td>");
html.append("</tr>");
for (Method method : tnsMethods) {
html.append("<tr>");
html.append("<td align=\"left\"> </td>");
html.append("<td align=\"left\">" + method.toString() + "</td>");
html.append("</tr>");
}
html.append("</table>");
html.append("</td></tr>");
html.append("</table>");
html.append("</body>");
html.append("</html>");
printHtml(response, html.toString());
}
use of org.axe.annotation.mvc.Request in project Axe by DongyuCai.
the class HomeController method dataSource.
@Request(value = "/dataSource", method = RequestMethod.GET)
public void dataSource(@RequestParam("token") String token, HttpServletRequest request, HttpServletResponse response) {
String contextPath = request.getContextPath();
StringBuilder html = new StringBuilder();
html.append("<!DOCTYPE html>");
html.append("<html>");
html.append("<head>");
html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />");
html.append("<title>axe datasource</title>");
html.append("</head>");
html.append("<body>");
html.append("<table width=\"100%\">");
html.append("<tr><td align=\"right\">");
if (ConfigHelper.getAxeSignIn()) {
html.append("<a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe/sign-out?token=" + token + "\"><b>退出</b></a>");
}
html.append(" <a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe?token=" + token + "\"><b>首页</b></a>");
html.append("</td></tr>");
Map<String, BaseDataSource> dataSourceMap = DataSourceHelper.getDataSourceAll();
html.append("<tr><td align=\"center\"><font size=\"28\">DataSource x" + dataSourceMap.size() + "</font></td></tr>");
html.append("");
html.append("<tr><td><table cellspacing=\"0px\"><tr><td style=\"background-color: #AE0000\">");
html.append(" <font color=\"white\"><b>DataSource</b></font> ");
html.append("</td></tr></table></td></tr>");
html.append("");
html.append("<tr><td height=\"2px\" style=\"background-color: #AE0000\"></td></tr>");
html.append("<tr><td>");
html.append("<table width=\"100%\">");
html.append("<tr style=\"background-color: #F0F0F0;\">");
html.append("<td align=\"left\"> </td>");
html.append("<td align=\"left\"><b>Name</b></td>");
html.append("<td align=\"left\"><b>Driver</b></td>");
html.append("<td align=\"left\"><b>Url</b></td>");
html.append("<td align=\"left\"><b>Username</b></td>");
html.append("<td align=\"left\"><b>Password</b></td>");
html.append("<td align=\"left\"><b>Class</b></td>");
html.append("</tr>");
for (Map.Entry<String, BaseDataSource> entry : dataSourceMap.entrySet()) {
String dataSourceName = entry.getKey();
BaseDataSource dataSource = entry.getValue();
html.append("<tr>");
html.append("<td align=\"left\"> </td>");
html.append("<td align=\"left\">" + dataSourceName + "</td>");
html.append("<td align=\"left\">" + dataSource.setJdbcDriver() + "</td>");
html.append("<td align=\"left\">" + dataSource.setJdbcUrl() + "</td>");
html.append("<td align=\"left\">" + dataSource.setJdbcUserName() + "</td>");
html.append("<td align=\"left\">" + dataSource.setJdbcPassword() + "</td>");
html.append("<td align=\"left\">" + dataSource.getClass() + "</td>");
html.append("</tr>");
}
html.append("</table>");
html.append("</td></tr>");
html.append("</table>");
html.append("</body>");
html.append("</html>");
printHtml(response, html.toString());
}
use of org.axe.annotation.mvc.Request in project Axe by DongyuCai.
the class HomeController method filter.
@Request(value = "/filter", method = RequestMethod.GET)
public void filter(@RequestParam("token") String token, HttpServletRequest request, HttpServletResponse response) {
String contextPath = request.getContextPath();
StringBuilder html = new StringBuilder();
html.append("<!DOCTYPE html>");
html.append("<html>");
html.append("<head>");
html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />");
html.append("<title>axe filter</title>");
html.append("</head>");
html.append("<body>");
html.append("<table width=\"100%\">");
html.append("<tr><td align=\"right\">");
if (ConfigHelper.getAxeSignIn()) {
html.append("<a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe/sign-out?token=" + token + "\"><b>退出</b></a>");
}
html.append(" <a style=\"font-size: 15px;color: #AE0000\" href=\"" + contextPath + "/axe?token=" + token + "\"><b>首页</b></a>");
html.append("</td></tr>");
List<Filter> filterList = FilterHelper.getSortedFilterList();
html.append("<tr><td align=\"center\"><font size=\"28\">Filter list x" + filterList.size() + "</font></td></tr>");
html.append("");
html.append("<tr><td><table cellspacing=\"0px\"><tr><td style=\"background-color: #AE0000\">");
html.append(" <font color=\"white\"><b>Filter</b></font> ");
html.append("</td></tr></table></td></tr>");
html.append("");
html.append("<tr><td height=\"2px\" style=\"background-color: #AE0000\"></td></tr>");
html.append("<tr><td>");
html.append("<table width=\"100%\">");
html.append("<tr style=\"background-color: #F0F0F0;\">");
html.append("<td align=\"left\"> </td>");
html.append("<td align=\"left\"><b>Level</b></td>");
html.append("<td align=\"left\"><b>Class</b></td>");
html.append("<td align=\"left\"><b>Mapping</b></td>");
html.append("<td align=\"left\"><b>NotMapping</b></td>");
html.append("</tr>");
int id = 1;
for (Filter filter : filterList) {
html.append("<tr>");
html.append("<td align=\"left\">" + (id++) + "</td>");
html.append("<td align=\"left\">" + filter.setLevel() + "</td>");
html.append("<td align=\"left\">" + filter.getClass() + "</td>");
Pattern mappingPattern = filter.setMapping();
String mappingRegex = mappingPattern == null ? "" : mappingPattern.toString();
html.append("<td align=\"left\">" + mappingRegex + "</td>");
Pattern notMappingPattern = filter.setNotMapping();
String notMappingRegex = notMappingPattern == null ? "" : notMappingPattern.toString();
html.append("<td align=\"left\">" + notMappingRegex + "</td>");
html.append("</tr>");
}
html.append("</table>");
html.append("</td></tr>");
html.append("</table>");
html.append("</body>");
html.append("</html>");
printHtml(response, html.toString());
}
Aggregations