I wrote simple function to secure your application From xss(cross site scripting) and sql injection
HOw to use:
Whenever you take eusr input from $_GET , $_POST etc just use it like
hammad($_POST[ Run It Now!
The below example demonstrates DateType Conversion in Struts 2. In this example if you will enter birth Date in (yyyy/mm/dd) formate. then it will convert in to (mon dd,yyyy) format and show on redirected page.