惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - 我是程序员

Kubernetes集群安全概述 EventStore .NET API Client在使用线程池线程同步写入Event导致EventStore连接中断的问题研究 Silverlight下实现Windows8风格的进度条 如何确保Silverlight按照区域设定自动加载对应区域的资源 查看进程的启动参数 (转) 如何在Access2007中打开加密的Access2003数据库 在WPF中如何注册热键 业务流程不是需求(ZT) 如何取消ActiveReport的打印任务 开源license总结(转) 如何将文本文件读入到DataSet中 利用Eclipse调试JSP XML文件的DOCTYPE定义(转) - 我是程序员 - 博客园 别让Hibernate偷走了您的身份(转) Firefox下强制页面缓存失效的设置方法 - 我是程序员 - 博客园 有关Struts标签<html:cancel>使用的一点提示 - 我是程序员 - 博客园 Struts Commons-validator的validation.xml验证文件的配置指南(转) - 我是程序员 - 博客园 大型Web2.0站点构建技术初探(转) 面向对象分析设计的六十一条经验原则(转贴)
如何定制Acegi验证框架的验证错误信息
我是程序员 · 2008-02-22 · via 博客园 - 我是程序员
  • 编写资源文件,Acegi的DaoAuthenticationProvider使用了如下的资源Key

AbstractUserDetailsAuthenticationProvider.badCredentials=自定消息
AbstractUserDetailsAuthenticationProvider.onlySupports
=自定消息
AbstractUserDetailsAuthenticationProvider.locked
=自定消息 account was locked
AbstractUserDetailsAuthenticationProvider.disabled
=自定消息account was disabled
AbstractUserDetailsAuthenticationProvider.expired
=自定消息
AbstractUserDetailsAuthenticationProvider.credentialsExpired
=自定消息


  • 定义资源Bean

    <bean id="messageSource"
        class
="org.springframework.context.support.ResourceBundleMessageSource">
    
<property name="basename">
            
<value>资源文件(包名+资源文件名)</value>
        
</property>
    
</bean>


  • 将资源Bean注入到DaoAuthenticationProvider

1    <bean id="daoAuthenticationProvider"
2        class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
3        <property name="userDetailsService">
4            <ref local="inMemoryDaoImpl" />
5        </property>
6        <property name="messageSource">
7            <ref bean="messageSource" />
8        </property>
9    </bean>