Capgemini Interview Question

How do we add validation in a webpage when working with jsp and servlet?