本文整理汇总了Java中org.lastaflute.web.LastaWebKey类的典型用法代码示例。如果您正苦于以下问题:Java LastaWebKey类的具体用法?Java LastaWebKey怎么用?Java LastaWebKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LastaWebKey类属于org.lastaflute.web包,在下文中一共展示了LastaWebKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyToken
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
@Override
public void verifyToken() {
requestManager.getHeader(getTokenHeaderName()).ifPresent(headerToken -> {
sessionManager.getAttribute(LastaWebKey.CSRF_TOKEN_KEY, String.class).ifPresent(savedToken -> {
if (!headerToken.equals(savedToken)) {
throwCsrfHeaderSavedTokenNotMatchedException(headerToken, savedToken);
}
}).orElse(() -> {
throwCsrfHeaderSavedTokenNotMatchedException(headerToken, null);
});
}).orElse(() -> {
throwCsrfHeaderNotFoundException();
});
}
示例2: doPrepare
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
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;
}
}
示例3: setupPushedActionForm
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void setupPushedActionForm(HtmlResponse response) {
response.getPushedFormInfo().ifPresent(formInfo -> {
final String formKey = LastaWebKey.PUSHED_ACTION_FORM_KEY;
VirtualForm form = createPushedActionForm(formInfo, formKey);
runtime.manageActionForm(OptionalThing.of(form)); // to export properties to request attribute
requestManager.setAttribute(formKey, form);
});
}
示例4: prepareTransactionMemoriesIfExists
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void prepareTransactionMemoriesIfExists() {
final SavedTransactionMemories memories = ThreadCacheContext.findTransactionMemories();
if (memories != null) {
final List<TransactionMemoriesProvider> providerList = memories.getOrderedProviderList();
final StringBuilder sb = new StringBuilder();
for (TransactionMemoriesProvider provider : providerList) {
provider.provide().ifPresent(result -> sb.append("\n*").append(result));
}
final WholeShowAttribute attribute = new WholeShowAttribute(sb.toString().trim());
requestManager.setAttribute(LastaWebKey.DBFLUTE_TRANSACTION_MEMORIES_KEY, attribute);
}
}
示例5: getReqeustUserLocaleKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getReqeustUserLocaleKey() {
return LastaWebKey.USER_LOCALE_KEY;
}
示例6: getSessionUserLocaleKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getSessionUserLocaleKey() {
return LastaWebKey.USER_LOCALE_KEY;
}
示例7: getReqeustUserTimeZoneKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getReqeustUserTimeZoneKey() {
return LastaWebKey.USER_TIMEZONE_KEY;
}
示例8: getSessionUserTimeZoneKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getSessionUserTimeZoneKey() {
return LastaWebKey.USER_TIMEZONE_KEY;
}
示例9: getErrorMessagesKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getErrorMessagesKey() {
return LastaWebKey.ACTION_ERRORS_KEY;
}
示例10: getInfoMessagesKey
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected String getInfoMessagesKey() {
return LastaWebKey.ACTION_INFO_KEY;
}
示例11: initModuleConfig
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void initModuleConfig(ServletContext servletContext) throws UnavailableException {
servletContext.setAttribute(LastaWebKey.MODULE_CONFIG_KEY, newModuleConfig());
}
示例12: saveMessageResourcesToContext
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void saveMessageResourcesToContext(ServletContext context) {
context.setAttribute(LastaWebKey.MESSAGE_RESOURCES_KEY, newMessageResources());
}
示例13: getMessageResources
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected MessageResources getMessageResources(ServletContext context) {
return (MessageResources) context.getAttribute(LastaWebKey.MESSAGE_RESOURCES_KEY);
}
示例14: saveRequestedSqlCount
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void saveRequestedSqlCount(ExecutedSqlCounter counter) {
requestManager.setAttribute(LastaWebKey.DBFLUTE_SQL_COUNT_KEY, createRequestedSqlCount(counter)); // logged by logging filter
}
示例15: saveRequestedMailCount
import org.lastaflute.web.LastaWebKey; //导入依赖的package包/类
protected void saveRequestedMailCount(PostedMailCounter counter) {
requestManager.setAttribute(LastaWebKey.MAILFLUTE_MAIL_COUNT_KEY, createRequestedMailCount(counter));
}