由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - display field validation message with the field
相关主题
web application请教What is good Java software?
so weird面试题,不知道怎么答好
AJAX framework for Java请问哪个J2EE MVC Framework最有前途
网上信用卡支付的java code怎么写?JSF和MVC model 2的问题
who can compare different framework?view templating technology
Anybody can recommend a framework article for building swinBrainbench test (转载)
JSF有前途吗哪位大牛可以总结一下各种java框架的基本思想,优于其它框架的地方以及适用范围。
Any body uses wicket framework for web development?spring MVC 下的rich web application
相关话题的讨论汇总
话题: field话题: validation话题: waffle话题: errors话题: display
进入Java版参与讨论
1 (共1页)
h**d
发帖数: 474
1
any suggestion for a good approach? would like to have an elegant way to
implement this,
since this will be the requirement for all the fields across the whole
project.
tools are used:
Waffle as web framework, validation is done in controller(action),
and validation messages are exposed in ${errors},
JSP and DOJO are used.
Business requirement:
when field validation fails, change the label to red, and display the error
message with the field
thanks.
g*****g
发帖数: 34805
2
Not familiar with Waffle, but most frameworks have a concept
of validator. e.g. Spring MVC has a validator interface that
has these two functions.
public boolean supports(Class givenClass)
public void validate(Object obj, Errors errors)
The first function specify the type of form bean,
the second one processes the form bean and append errors.
Then you can have a custom jsp tag to do view if the framework
doesn't already have one.

error

【在 h**d 的大作中提到】
: any suggestion for a good approach? would like to have an elegant way to
: implement this,
: since this will be the requirement for all the fields across the whole
: project.
: tools are used:
: Waffle as web framework, validation is done in controller(action),
: and validation messages are exposed in ${errors},
: JSP and DOJO are used.
: Business requirement:
: when field validation fails, change the label to red, and display the error

h**d
发帖数: 474
3
Thanks for the suggestion.
I don't have any problem from the server side, web framework does not really
matter.
In my case, after the validation, all the validation errors will be exposed
in ${errors},
need to have a good way of linking the specific error to the field(maybe use
custom tag?),
and change the label for that field to a different color.
I have not tried custom tag yet, since it needs to change the label color,
and append error message to the field. Also it needs to handle all possibl

【在 g*****g 的大作中提到】
: Not familiar with Waffle, but most frameworks have a concept
: of validator. e.g. Spring MVC has a validator interface that
: has these two functions.
: public boolean supports(Class givenClass)
: public void validate(Object obj, Errors errors)
: The first function specify the type of form bean,
: the second one processes the form bean and append errors.
: Then you can have a custom jsp tag to do view if the framework
: doesn't already have one.
:

s******e
发帖数: 493
4
Even I do not think that you should use innerhtml, it should be doable.
If I were you, I would first check waffle doc to see if it has some built-in
tags. If there is none, you might want to email the guy who found the
waffle. Never used waffle before, but several years ago had a quick look at
the project. The guy should be from thoughtworks. I am not sure if he is
still with them.
For me, innerhtml should be used in xmlhttprequest(ajax) for partial refresh
or some client side only action such
h**d
发帖数: 474
5
agreed...
Mike ward is one of my best friends...unfortunately, waffle does not provide
good tags to let you select where to display error messages:(
I was not the one who chose waffle, the person who chose the framework left
the project:( Actually I like waffle a lot, but I would not suggest it for
professional projects, since it does not have strong community. Lack of tag
support is another issue.

in
at
refresh

【在 s******e 的大作中提到】
: Even I do not think that you should use innerhtml, it should be doable.
: If I were you, I would first check waffle doc to see if it has some built-in
: tags. If there is none, you might want to email the guy who found the
: waffle. Never used waffle before, but several years ago had a quick look at
: the project. The guy should be from thoughtworks. I am not sure if he is
: still with them.
: For me, innerhtml should be used in xmlhttprequest(ajax) for partial refresh
: or some client side only action such

1 (共1页)
进入Java版参与讨论
相关主题
spring MVC 下的rich web applicationwho can compare different framework?
谁能给我推荐一个strutsspringhibernate的项目Anybody can recommend a framework article for building swin
Web App framework in Java ?JSF有前途吗
发现Ninja framework 做web REST 挺好使Any body uses wicket framework for web development?
web application请教What is good Java software?
so weird面试题,不知道怎么答好
AJAX framework for Java请问哪个J2EE MVC Framework最有前途
网上信用卡支付的java code怎么写?JSF和MVC model 2的问题
相关话题的讨论汇总
话题: field话题: validation话题: waffle话题: errors话题: display