You are getting
String pageNo=req.getParameter("pageNo") as 'null' string, thats why it is going inside null check, but pageNo is not null ie it is value 'null' as string, and definitely the number format exception will come for input as "null" or any string which does not include any number.
you need to check where you passing the parameter pageNo, it is passing properly or not.