64 |
64 |
65 public static String fqn(Class<?> clazz, String name) { |
65 public static String fqn(Class<?> clazz, String name) { |
66 return fqn(clazz.getName(), name); |
66 return fqn(clazz.getName(), name); |
67 } |
67 } |
68 |
68 |
69 public static String fullPath(LightPITModule module, RequestMapping mapping) { |
69 public static String baseHref(HttpServletRequest req) { |
70 StringBuilder sb = new StringBuilder(); |
70 return String.format("%s://%s:%d%s/", |
71 sb.append(module.modulePath()); |
71 req.getScheme(), |
72 sb.append('/'); |
72 req.getServerName(), |
73 if (!mapping.requestPath().isEmpty()) { |
73 req.getServerPort(), |
74 sb.append(mapping.requestPath().isEmpty()); |
74 req.getContextPath()); |
75 sb.append('/'); |
|
76 } |
|
77 return sb.toString(); |
|
78 } |
75 } |
79 |
76 |
80 public static String fullPath(HttpServletRequest req) { |
77 public static String fullPath(HttpServletRequest req) { |
81 return req.getServletPath() + Optional.ofNullable(req.getPathInfo()).orElse(""); |
78 return req.getServletPath() + Optional.ofNullable(req.getPathInfo()).orElse(""); |
82 } |
79 } |