Adv Java Program : Write a JSP script to validate given E-Mail ID.
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>
0 Comments