SecurID® Governance & Lifecycle Blog

Subscribe to the official SecurID Governance & Lifecycle community blog for information about new product features, industry insights, best practices, and more.

Email field validation JSP for Access Request forms

ChitraAnilkumar
Moderator Moderator
Moderator
1 0 1,508

Following is the contents of the field validation jsp for validating if a text field for email address has it in the right format:

<%@ page import="java.io.*"%>

<%@ page import="java.util.*"%>

<%@ page import="java.util.regex.*"%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%

                try {

                                String name = request.getParameter("name");

                                String question = request.getParameter("question");

                                String value = request.getParameter("value");

                     Pattern pattern = Pattern.compile("^.+@.+\\..+$");

                                Matcher matcher = pattern.matcher(value);

                                if (!matcher.matches())

                                                out.println("Invalid User Id for " + question + ", expected ####@####.###");

                                }

                catch (IOException e) {

                       e.printStackTrace();

                }

%>

For details on field and form validation jsps, refer here:

https://community.rsa.com/docs/DOC-32532