Write a JSP script to check whether given mail ID is valid or not. (Mail ID should contain one @ symbol and atleast one Dot(.) symbol)

Email.html

<html>
<body>
<form name=f1 action="EmailCheck.jsp">
<fieldset>
<legend>Enter Email Id...!!!</legend>
        Enter Email Id:<input type="text" name="t1" >
</fieldset>
<div align=center>
<input type="submit" name="Submit" value="Submit">
</div>
</form>
</body>
</html>
        

Emailcheck.jsp
<html>
<body>
<%@ page language="java" %>
<%
        String email=request.getParameter("t1");
        if(email.contains("@") && email.contains("."))
        {
        out.println("Given Email Id is Valid");
        }
        else        {
        out.println("Given Email id is not Valid");
        }
        %>
</body>
</html>