List of questions
Related questions
Question 34 - 312-96 discussion
Suppose there is a productList.jsp page, which displays the list of products from the database for the requested product category. The product category comes as a request parameter value. Which of the following line of code will you use to strictly validate request parameter value before processing it for execution?
A.
public boolean validateUserName() {String CategoryId= request.getParameter('CatId');}
B.
public boolean validateUserName() { Pattern p = Pattern.compile('[a-zA-Z0-9]*$'); Matcher m = p.matcher(request.getParameter(CatId')); boolean result = m.matches(); return result;}
C.
public boolean validateUserName() { if(request.getParameter('CatId')!=null ) String CategoryId=request.getParameter('CatId');}
D.
public.boolean validateUserName() { if(!request.getParamcter('CatId').equals('null'))}Answer: B
Your answer:
0 comments
Sorted by
Leave a comment first