protected void adjustActionResponseJustBefore(ActionResponse response) { adjustmentProvider.adjustActionResponseJustBefore(runtime, response); }
protected ResponseReflectingOption adjustResponseReflecting() { // not null final ResponseReflectingOption option = adjustmentProvider.adjustResponseReflecting(); return option != null ? option : NULLOBJ_REFLECTING_OPTION; } }
protected VaConfigSetupper adjustValidatorConfig() { // in callback final ActionAdjustmentProvider adjustmentProvider = requestManager.getActionAdjustmentProvider(); final VaConfigSetupper setupper = adjustmentProvider.adjustValidatorConfig(); return setupper != null ? setupper : EMPTY_CONF_SETUPPER; }
protected String filterHtmlPath(String path) { String origin = path; if (isJspPath(origin)) { final String viewPrefix = LaServletContextUtil.getJspViewPrefix(); if (viewPrefix != null) { origin = viewPrefix + origin; // e.g. /WEB-INF/view/... } } final String filtered = adjustmentProvider.filterHtmlPath(origin, this); return filtered != null ? filtered : origin; }
protected boolean isAppExWithoutInfo(RuntimeException cause) { if (cause instanceof LaApplicationException && ((LaApplicationException) cause).isHandledWithoutInfo()) { return true; } final ApplicationExceptionOption option = requestManager.getActionAdjustmentProvider().adjustApplicationExceptionHandling(); if (option != null && option.getAppExInfoSuppressor().map(sup -> sup.isSuppress(cause)).orElse(false)) { return true; } return false; }
protected static InOutLogKeeper doPrepare(RequestManager requestManager) { final String key = LastaWebKey.INOUT_LOGGING_KEY; final OptionalThing<NonShowAttribute> optAttr = requestManager.getAttribute(key, NonShowAttribute.class); if (optAttr.isPresent()) { final NonShowAttribute attr = optAttr.get(); return (InOutLogKeeper) attr.getAttribute(); } else { final InOutLogKeeper keeper = new InOutLogKeeper(); keeper.acceptOption(requestManager.getActionAdjustmentProvider().adjustInOutLogging()); // null allowed requestManager.setAttribute(key, new NonShowAttribute(keeper)); return keeper; } }
protected String simplyCustomizeActionMappingRequestPath(String requestPath) { final String customized = actionAdjustmentProvider.customizeActionMappingRequestPath(requestPath); return customized != null ? customized : requestPath; }
protected MappingPathResource deeplyCustomizeUrlMapping(String requestPath, String simplyFiltered) { final UrlMappingOption option = actionAdjustmentProvider.customizeActionUrlMapping(createUrlMappingResource(requestPath)); final String mappingPath; final String actionNameSuffix; if (option != null) { mappingPath = option.getRequestPathFilter().map(filter -> filter.apply(simplyFiltered)).orElse(simplyFiltered); actionNameSuffix = option.getActionNameSuffix().orElse(null); } else { mappingPath = simplyFiltered; actionNameSuffix = null; } return new MappingPathResource(requestPath, mappingPath, actionNameSuffix); }
protected UrlReverseOption customizeActionUrlReverse(Class<?> actionType, UrlChain chain) { final UrlReverseOption option = actionAdjustmentProvider.customizeActionUrlReverse(createUrlReverseResource(actionType, chain)); return option != null ? option : EMPTY_URL_REVERSE_OPTION; }
protected FormMappingOption adjustFormMapping() { final FormMappingOption option = getAdjustmentProvider().adjustFormMapping(); return option != null ? option : NULLOBJ_FORM_MAPPING_OPTION; }
protected String filterHtmlPath(String path) { String origin = path; if (isJspPath(origin)) { final String viewPrefix = LaServletContextUtil.getJspViewPrefix(); if (viewPrefix != null) { origin = viewPrefix + origin; // e.g. /WEB-INF/view/... } } final String filtered = adjustmentProvider.filterHtmlPath(origin, this); return filtered != null ? filtered : origin; }
protected boolean isAppExWithoutInfo(RuntimeException cause) { if (cause instanceof LaApplicationException && ((LaApplicationException) cause).isHandledWithoutInfo()) { return true; } final ApplicationExceptionOption option = requestManager.getActionAdjustmentProvider().adjustApplicationExceptionHandling(); if (option != null && option.getAppExInfoSuppressor().map(sup -> sup.isSuppress(cause)).orElse(false)) { return true; } return false; }
protected static InOutLogKeeper doPrepare(RequestManager requestManager) { final String key = LastaWebKey.INOUT_LOGGING_KEY; final OptionalThing<NonShowAttribute> optAttr = requestManager.getAttribute(key, NonShowAttribute.class); if (optAttr.isPresent()) { final NonShowAttribute attr = optAttr.get(); return (InOutLogKeeper) attr.getAttribute(); } else { final InOutLogKeeper keeper = new InOutLogKeeper(); keeper.acceptOption(requestManager.getActionAdjustmentProvider().adjustInOutLogging()); // null allowed requestManager.setAttribute(key, new NonShowAttribute(keeper)); return keeper; } }
protected String simplyCustomizeActionMappingRequestPath(String requestPath) { final String customized = actionAdjustmentProvider.customizeActionMappingRequestPath(requestPath); return customized != null ? customized : requestPath; }
protected MappingPathResource deeplyCustomizeUrlMapping(String requestPath, String simplyFiltered) { final UrlMappingOption option = actionAdjustmentProvider.customizeActionUrlMapping(createUrlMappingResource(requestPath)); final String mappingPath; final String actionNameSuffix; if (option != null) { mappingPath = option.getRequestPathFilter().map(filter -> filter.apply(simplyFiltered)).orElse(simplyFiltered); actionNameSuffix = option.getActionNameSuffix().orElse(null); } else { mappingPath = simplyFiltered; actionNameSuffix = null; } return new MappingPathResource(requestPath, mappingPath, actionNameSuffix); }
protected UrlReverseOption customizeActionUrlReverse(Class<?> actionType, UrlChain chain) { final UrlReverseOption option = actionAdjustmentProvider.customizeActionUrlReverse(createUrlReverseResource(actionType, chain)); return option != null ? option : EMPTY_URL_REVERSE_OPTION; }
protected FormMappingOption adjustFormMapping() { final FormMappingOption option = getAdjustmentProvider().adjustFormMapping(); return option != null ? option : NULLOBJ_FORM_MAPPING_OPTION; }
protected VaConfigSetupper adjustValidatorConfig() { // in callback final ActionAdjustmentProvider adjustmentProvider = requestManager.getActionAdjustmentProvider(); final VaConfigSetupper setupper = adjustmentProvider.adjustValidatorConfig(); return setupper != null ? setupper : EMPTY_CONF_SETUPPER; }
protected ResponseReflectingOption adjustResponseReflecting() { // not null final ResponseReflectingOption option = adjustmentProvider.adjustResponseReflecting(); return option != null ? option : NULLOBJ_REFLECTING_OPTION; } }
protected void adjustActionResponseJustBefore(ActionResponse response) { adjustmentProvider.adjustActionResponseJustBefore(runtime, response); }