public String prepareExpectedRoutingMessage(String requestPath) { // for debug final StringBuilder sb = new StringBuilder(); sb.append("\n"); sb.append("/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *No routing action:\n"); sb.append("e.g. expected actions for ").append(requestPath).append("\n"); final MappingPathResource pathResource = customizeActionMapping(requestPath); final List<String> nameList = buildExpectedRoutingActionList(pathResource.getMappingPath()); boolean exists = false; for (String name : nameList) { if (name.endsWith("@index()") && containsNotAllowedCharacterAsActionPath(requestPath)) { // e.g. /product/List/ continue; } final String packageExp = Srl.substringLastFront(name, "."); if (!containsNotAllowedCharacterAsActionPath(packageExp)) { sb.append(" web.").append(name).append("\n"); exists = true; } } if (exists) { sb.append(" (and so on...)\n"); } else { sb.append(" *no suggestion... e.g. cannot use upper case in action path\n"); } sb.append("= = = = = = = = = =/"); return sb.toString(); }
public String prepareExpectedRoutingMessage(String requestPath) { // for debug final StringBuilder sb = new StringBuilder(); sb.append("\n"); sb.append("/= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *No routing action:\n"); sb.append("e.g. expected actions for ").append(requestPath).append("\n"); final MappingPathResource pathResource = customizeActionMapping(requestPath); final List<String> nameList = buildExpectedRoutingActionList(pathResource.getMappingPath()); boolean exists = false; for (String name : nameList) { if (name.endsWith("@index()") && containsNotAllowedCharacterAsActionPath(requestPath)) { // e.g. /product/List/ continue; } final String packageExp = Srl.substringLastFront(name, "."); if (!containsNotAllowedCharacterAsActionPath(packageExp)) { sb.append(" web.").append(name).append("\n"); exists = true; } } if (exists) { sb.append(" (and so on...)\n"); } else { sb.append(" *no suggestion... e.g. cannot use upper case in action path\n"); } sb.append("= = = = = = = = = =/"); return sb.toString(); }
/** * Handle the action path from the specified request path. * @param requestPath The request path to be analyzed. (NotNull) * @param handler The handler of the action path when the action is found. (NotNull) * @return Is it actually handled? (false if not found) * @throws Exception When the handler throws or internal process throws. */ public boolean handleActionPath(String requestPath, ActionFoundPathHandler handler) throws Exception { assertArgumentNotNull("requestPath", requestPath); assertArgumentNotNull("handler", handler); final MappingPathResource pathResource = customizeActionMapping(requestPath); return mappingActionPath(pathResource, handler); }
/** * Handle the action path from the specified request path. * @param requestPath The request path to be analyzed. (NotNull) * @param handler The handler of the action path when the action is found. (NotNull) * @return Is it actually handled? (false if not found) * @throws Exception When the handler throws or internal process throws. */ public boolean handleActionPath(String requestPath, ActionFoundPathHandler handler) throws Exception { assertArgumentNotNull("requestPath", requestPath); assertArgumentNotNull("handler", handler); final MappingPathResource pathResource = customizeActionMapping(requestPath); return mappingActionPath(pathResource, handler); }