ECCouncil Certified Application Security Engineer (CASE) JAVA 312-96 Question # 13 Topic 2 Discussion

ECCouncil Certified Application Security Engineer (CASE) JAVA 312-96 Question # 13 Topic 2 Discussion

312-96 Exam Topic 2 Question 13 Discussion:
Question #: 13
Topic #: 2

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"))}


Get Premium 312-96 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.