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

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 我是程序员

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>