60 435
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #25591 in Java | JSP | JSF for Ikanor Lika

Question #25591
please, explain these to me using simple english.


if(name.matches(userId),

String name = session.getAttribute("name"),

String prodID=request.getParameter("productID");
//int no=Interger.parseInt(prodID);
int sumcount=0;,
Expert's answer
Going line after line =) if(name.matches(userId),
String name =session.getAttribute("name"),

in case String variable called name matches regex pattern(regex is a regular expressions language) stored in userId variable
String name will get value, stored in the session (session is a personaldata store for any user, visiting the page, you can put anything there and
retrieve things you've stored there.) by the key 'name'

StringprodID=request.getParameter("productID");

Left part is similar to the previous line.'request.getParameter("productID")' retrieving info stored in the
HTTPRequest sent by user to the server. (both POST and GET requests) with
attribute name='productID'

//int no=Interger.parseInt(prodID);
commented code. will do nothing. uncomment it and it willtransform info from prodID to integer, or will crash if non0numeric data is
stored or null int sumcount=0; - variable declaration

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions