There was a NULL pointer exception occurred in production I am trying to replicate the run time exception in my local system. I am actually using the fire fox tamper tool to intercept the post parameters. I entered NULL values in the tamper window and submit the request to serer side code.
Post parameter are ccNumber , ccYear and ccMonth. all these variables are defined in JSP page. this is a legacy code developed a way back so you see hell lot of scriptlet code in jsp
On the webpage page after user submits the credit card number, month and year fields we use AJAX to post the parameters to the below JSP page. I am actually intercept the request parameters using fire fox tamper data and sets all these values to null and submit the tamper data.. but interestingly the values are coming as null in JSP page but didn't throw the NULL pointer exception if I use ccNumber.lenghth () method , instead it shows the length as 4. Am am setting the right values in tamper tool window ?? I am just changing the parameter value to null,perhaps this isn't correct?
Why the value is not coming as null in JSP page??
Payment.jsp
ccNumber = (request.getParameter("ccNumber"));
ccExpireMonth = (request.getParameter("ccExpireMonth"));
ccExpireYear = (request.getParameter("ccExpireYear"));
ccType = (request.getParameter("ccType"));
If ( cisCardNotVlaid)
{
ccNumber .length () == 0 // this suppose to throw the NULL pointer exception .