1

I just want to check that the parameter passed to the jsp are null or not using httpcontext so how i can able to do that

case_yr = Integer.parseInt(request.getParameter("case_yr"));
sub_type_int =Integer.parseInt(request.getParameter("sub_type_int"));
String case_num = request.getParameter("case_num");
String lang_mode = request.getParameter("lang_mode");
String mobile_no = request.getParameter("caller_id");
String dialled_id = request.getParameter("dialled_id");

i want to above values are valid or not I am submitting value from xml page to jsp page and getting value in jsp using request.getparameter()

so pleaase tell how to check values are null or not and there is no sevlet only vxml page and jsp page

Sumit Singh
  • 15,743
  • 6
  • 59
  • 89
deepak
  • 51
  • 2
  • 6

2 Answers2

0

if you wanna check if the request attributes are null,just check if they are null this way

String case_num = request.getParameter("case_num");
if(case_num!=null){
    //do your logic
 }
 else {
  System.out.println("case_num is null");
  }
 int number ;
String num = request.getParameter(num);
 if(num!=null){
     number = Integer.parseInt(num);
   }
 else {
  System.out.println("case_num is null");
  }
PermGenError
  • 45,977
  • 8
  • 87
  • 106
0

Use JSTL

<c:if test="${not empty case_num}">
    case_num is NOT empty or null.
</c:if>
jddsantaella
  • 3,657
  • 1
  • 23
  • 39