开发者

Validation framework advantages in struts2

What will be the advantages of the Validation framework in struts2.

Will it be validate the form on the client side or t开发者_如何学Che server side.

Please give me the suggestion on it.


The first advantage that comes to my mind is that it executes as an interceptor, so validation logic is separated from actual action(You must be aware that interceptors are called before/after action).This makes the logic clean i.e. populate the data in separate logic, validate in different and perform business logic in a separate one.

Struts2 validation could be done on both server side or client side. You have choice to use xml, annotation or manual validation. This link is a good place to start learning

For a more detailed discussion look here

Following are some basic examples

  • xml based
  • Annotation based
  • Client side
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜