由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Spring custom validation errors.
相关主题
在线等,Tomcat JSP syntax error
a stupid questionRe: 关于APPLET的IO问题
How can I alert a spring message?jar 的问题, 路径有问题? 大家帮忙看看是啥毛病?
Inject property file into a spring bean?java thread question
请教汉字的utf-8 mapping (转载)怎么返回空指针呢?
这叫啥名词?what wrong with jboss?
JSTL problemwhat's wrong with this simple applet? (转载)
Help with Tomcat for Eclipse v1.03[合集] 帮我看看这个问题出在哪。
相关话题的讨论汇总
话题: errors话题: spring话题: showform话题: check
进入Java版参与讨论
1 (共1页)
g*****g
发帖数: 34805
1
I know how to specify a validator to validate the data from input, but
within
SimpleFormController, after you finish inital check, sometimes you need to
perform a database check.
e.g. Make sure the new password doesn't equal to the old one.
I check the document, it seems I have to call the showForm method if
I find errors. The error is of type BindException, Now the only question is
how to I construct a BindException so that it supports I18N?
g*****g
发帖数: 34805
2
Is it calling getErrorsForNewForm?
BindException errors = getErrorsForNewForm(request);
errors.reject(...);
return showForm(request, response, errors);
Had to dig into source code a bit and find out, :-)

is

【在 g*****g 的大作中提到】
: I know how to specify a validator to validate the data from input, but
: within
: SimpleFormController, after you finish inital check, sometimes you need to
: perform a database check.
: e.g. Make sure the new password doesn't equal to the old one.
: I check the document, it seems I have to call the showForm method if
: I find errors. The error is of type BindException, Now the only question is
: how to I construct a BindException so that it supports I18N?

1 (共1页)
进入Java版参与讨论
相关主题
[合集] 帮我看看这个问题出在哪。请教汉字的utf-8 mapping (转载)
static object assignment/init ?这叫啥名词?
如何在TextArea里面画位图JSTL problem
Java Resource一问Help with Tomcat for Eclipse v1.03
在线等,Tomcat JSP syntax error
a stupid questionRe: 关于APPLET的IO问题
How can I alert a spring message?jar 的问题, 路径有问题? 大家帮忙看看是啥毛病?
Inject property file into a spring bean?java thread question
相关话题的讨论汇总
话题: errors话题: spring话题: showform话题: check