Reputation: 3
Which have a better validation, HTML5 or Struts2? I was developing a project using the Struts2 structure but I am always confused and getting difficulties with it, and I found out that there is a validation at HTML5. So I was wondering if it is more reliable if I use HTML5 rather than the Struts2 validation.
Upvotes: 0
Views: 109
Reputation: 144
Struts2 validation is not the purely server side validation and not a client side validation too. Its taken as front-end validation of web application. By the way you can use this as your preference. All the clients are not well support for html5. So its better to choose struts2 validation. You would be able to do it on separate validation xml file. But its not must.
Upvotes: 0
Reputation: 1228
Validation in HTML5 would be at the client end. Also if you have a browser that doesn't support complete HTML5 based validation, then they would not work.
Struts2 is a server side validation, which means if a client manages to send incorrect data it would be rejected at your server side.
In my opinion it is a MUST to have a Server Side validation (struts2 in your case) if your application is external facing (i.e. exposed to external users). Client side validations (HTML5) can support you to make the experience faster.
For more details refer here
Upvotes: 1