本文整理匯總了Java中org.springframework.context.annotation.Description類的典型用法代碼示例。如果您正苦於以下問題:Java Description類的具體用法?Java Description怎麽用?Java Description使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Description類屬於org.springframework.context.annotation包,在下文中一共展示了Description類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: templateEngine
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Bean
@Description("Thymeleaf template engine with Spring integration")
public SpringTemplateEngine templateEngine(final TemplateResolver templateResolver)
throws Exception {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setTemplateResolver(templateResolver);
engine.addDialect(new SpringSecurityDialect());
engine.addDialect(new LayoutDialect(new GroupingStrategy()));
engine.afterPropertiesSet();
return engine;
}
示例2: viewResolver
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Bean
@Description("Thymeleaf view resolver")
public ViewResolver viewResolver(final SpringTemplateEngine templateEngine) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine);
resolver.setCharacterEncoding("UTF-8");
resolver.setCache(false);
resolver.setOrder(1);
return resolver;
}
示例3: contextSource
import org.springframework.context.annotation.Description; //導入依賴的package包/類
/**
* LDAP Server Context
* TODO: Need to get port / URL from properties.
* @return
*/
@Description("Embedded LDAP Context Config")
@Bean
public DefaultSpringSecurityContextSource contextSource() {
return new DefaultSpringSecurityContextSource(
Arrays.asList("ldap://localhost:" + LDAP_PORT + "/"), "dc=jbcpcalendar,dc=com"){{
setUserDn("[email protected],ou=Administrators");
// setUserDn("uid=admin, ou=system");
// setPassword("secret");
setPassword("admin1");
}};
}
示例4: myEvents
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Description("Get events for a currently Pricipal CalendarUser")
@GetMapping("/my")
public ModelAndView myEvents() {
CalendarUser currentUser = userContext.getCurrentUser();
Integer currentUserId = currentUser.getId();
ModelAndView result = new ModelAndView("events/my",
"events",
calendarService.findForUser(currentUserId));
result.addObject("currentUser", currentUser);
return result;
}
示例5: thymeleafViewResolver
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Bean
@Description("Thymeleaf view resolver")
public ThymeleafViewResolver thymeleafViewResolver(final SpringTemplateEngine templateEngine) {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine);
resolver.setCharacterEncoding("UTF-8");
resolver.setCache(false);
resolver.setOrder(1);
return resolver;
}
示例6: defaultExpressionHandler
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Description("DefaultMethodSecurityExpressionHandler")
@Bean
public DefaultMethodSecurityExpressionHandler defaultExpressionHandler(EventDao eventDao){
DefaultMethodSecurityExpressionHandler deh = new DefaultMethodSecurityExpressionHandler();
deh.setPermissionEvaluator(
new CalendarPermissionEvaluator(eventDao));
return deh;
}
示例7: accessDecisionManager
import org.springframework.context.annotation.Description; //導入依賴的package包/類
@Description("ConsensusBased AccessDecisionManager for Authorization voting")
@Bean
public AccessDecisionManager accessDecisionManager(
CustomWebSecurityExpressionHandler customWebSecurityExpressionHandler) {
List<AccessDecisionVoter<? extends Object>> decisionVoters
= Arrays.asList(
// new AuthenticatedVoter(),
// new RoleVoter(),
new WebExpressionVoter(){{
setExpressionHandler(customWebSecurityExpressionHandler);
}}
);
return new ConsensusBased(decisionVoters);
}
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:15,代碼來源:CustomAuthorizationConfig.java