/** * 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); }
/** * Convert to URL string to move the action. <br> * e.g. ProductListAction to /product/list/ <br> * And not contain context path. * @param actionType The class type of action that it redirects to. (NotNull) * @return The URL string to move to the action. (NotNull) */ public String toActionUrl(Class<?> actionType) { assertArgumentNotNull("actionType", actionType); return toActionUrl(actionType, EMPTY_URL_CHAIN); }
/** * Convert to URL string to move the action. <br> * e.g. ProductListAction to /product/list/ <br> * And not contain context path. * @param actionType The class type of action that it redirects to. (NotNull) * @return The URL string to move to the action. (NotNull) */ public String toActionUrl(Class<?> actionType) { assertArgumentNotNull("actionType", actionType); return toActionUrl(actionType, EMPTY_URL_CHAIN); }
/** * 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); }
/** * Convert to URL string to move the action. <br> * e.g. ProductListAction with moreUrl(3) to /product/list/3 <br> * And not contain context path. * @param actionType The class type of action that it redirects to. (NotNull) * @param chain The chain of URL to build additional info on URL. (NotNull) * @return The URL string to move to the action. (NotNull) */ public String toActionUrl(Class<?> actionType, UrlChain chain) { assertArgumentNotNull("actionType", actionType); assertArgumentNotNull("chain", chain); final UrlReverseOption option = customizeActionUrlReverse(actionType, chain); // not null, empty allowed final StringBuilder sb = new StringBuilder(); buildActionPath(sb, actionType, option); buildUrlParts(sb, chain); buildGetParam(sb, chain); buildHashOnUrl(sb, chain); return sb.toString(); }
/** * Convert to URL string to move the action. <br> * e.g. ProductListAction with moreUrl(3) to /product/list/3 <br> * And not contain context path. * @param actionType The class type of action that it redirects to. (NotNull) * @param chain The chain of URL to build additional info on URL. (NotNull) * @return The URL string to move to the action. (NotNull) */ public String toActionUrl(Class<?> actionType, UrlChain chain) { assertArgumentNotNull("actionType", actionType); assertArgumentNotNull("chain", chain); final UrlReverseOption option = customizeActionUrlReverse(actionType, chain); // not null, empty allowed final StringBuilder sb = new StringBuilder(); buildActionPath(sb, actionType, option); buildUrlParts(sb, chain); buildGetParam(sb, chain); buildHashOnUrl(sb, chain); return sb.toString(); }