AnsweredAssumed Answered

Form level validation not working for RSA 7.0.1.134339 P04

Question asked by Mansi Sheth on Jan 31, 2019
Latest reply on Jan 31, 2019 by Mansi Sheth

Hi,

 

We are using 7.0.1.134339 P04.

 

We are using custom jsp to validate basic form level validation. Below is the screenshot how we are calling the jsp. Here we are validating if a serial number that we input in textbox already exists for any user or not.

 

PFB how we developed jsp -

 

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

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

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

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

 

<%

 

    HashMap<String, String> values = new HashMap<String, String>();

 

    HashMap<String, String> questions = new HashMap<String, String>();

 

 

 

    // Make the parameters and questions easy to access

 

    for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {

 

        String name = e.nextElement().toString();

 

        String value = request.getParameter(name);

 

        if (name.startsWith("value.")) values.put(name.substring(6), value);

 

        if (name.startsWith("question.")) questions.put(name.substring(9), value);

 

    }

 

 

 

    System.out.println("validateform.jsp request method=" + request.getMethod());

 

    System.out.println("validateform.jsp parameterMap=" + request.getParameterMap());

 

    System.out.println("validateform.jsp values=" + values);

 

    System.out.println("validateform.jsp questions=" + questions);

 

 

 

    Properties outputProps = new Properties();

 

 

 

    if (!values.containsKey("NEFTID")) {

 

        outputProps.put("error","Where is the NEFTID field!");

 

    } else  if ( values.get("NatID") != "" ) {

 

        outputProps.put("error.NEFTID","Please change the NEFTID as this already exists for another user:TEST");

 

        outputProps.put("error","Form validation failed!");

 

    }

 

 

 

    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

 

    outputProps.store(outputStream, null);

 

    outputStream.close();

 

    out.print(outputStream.toString("ISO-8859-1"));

 

%>

 

 

It works fine and throws error when serial number already exists for user but does not work when we input new serial number. Ideally it should go on next page but its not happening .

Any suggestion what could be issue.

Attachments

Outcomes