1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)
 

Recent Questions

!!! JSP Frequently Asked Questions !!!

Q. How to add and delete Cookie in jsp ?

!!!Answer!!!- From Technical Expert

Add Cookie to response object:
Cookie cookie = new Cookie ("name",value);
cookie.setPath("/");
cookie.setDomain(DOMAIN_NAME); DOMAIN_NAME may be .techfaq360.com
cookie.setMaxAge(2* 7 * 24 * 60 * 60);// 2 week
response.addCookie(cookie);

Get cookie from request object :

Cookie myCookie = null;

Cookie cookies [] = request.getCookies ();
if (cookies != null)
for (int i = 0; i < cookies.length; i++)
{
if (cookies [i].getName().equals ("name")) // the name of the cookie you have added
{
myCookie = cookies[i];
break;
}
}

Delete Cookie:

You can't delete the cookie. just add maxage to 0;
cookie.setMaxAge(0);
cookie.setPath("/");
cookie.setDomain(DOMAIN_NAME);
response.addCookie(cookie);

cookie.setMaxAge(-1) means on browser close cookie will be deleted.

Answered By : null Replied Date : Dec 30 2013
Answer :


Answered By : null Replied Date : Dec 20 2013
Answer :


Answered By : null Replied Date : Nov 25 2013
Answer :


Answered By : null Replied Date : Nov 6 2013
Answer :


Answered By : null Replied Date : Nov 3 2013
Answer :


Answered By : null Replied Date : Nov 2 2013
Answer :


Answered By : null Replied Date : Nov 1 2013
Answer :


Answered By : null Replied Date : Nov 1 2013
Answer :


Answered By : null Replied Date : Oct 29 2013
Answer :


Answered By : null Replied Date : Oct 27 2013
Answer :


Answered By : null Replied Date : Oct 23 2013
Answer :


Answered By : null Replied Date : Oct 21 2013
Answer :


Answered By : null Replied Date : Feb 7 2014
Answer :


Answered By : null Replied Date : Feb 7 2014
Answer :


Answered By : null Replied Date : Feb 7 2014
Answer :


Answered By : null Replied Date : Mar 5 2014
Answer :


Answered By : null Replied Date : Mar 19 2014
Answer :


Answered By : null Replied Date : Mar 25 2014
Answer :


Answered By : null Replied Date : Aug 16 2014
Answer :


Answered By : null Replied Date : Sep 28 2014
Answer :


Answered By : null Replied Date : Nov 3 2014
Answer :


Answered By : null Replied Date : Nov 3 2014
Answer :


Answered By : null Replied Date : Nov 4 2014
Answer :


Answered By : null Replied Date : Nov 4 2014
Answer :


Answered By : null Replied Date : Nov 9 2014
Answer :


Answered By : null Replied Date : Nov 12 2014
Answer :


Answered By : null Replied Date : Nov 17 2014
Answer :


Answered By : null Replied Date : Nov 20 2014
Answer :


Answered By : null Replied Date : Nov 23 2014
Answer :


Answered By : null Replied Date : Nov 25 2014
Answer :


Answered By : null Replied Date : Nov 27 2014
Answer :


Answered By : null Replied Date : Nov 30 2014
Answer :


Answered By : null Replied Date : Dec 8 2014
Answer :


Answered By : null Replied Date : Dec 12 2014
Answer :


Answered By : null Replied Date : Dec 20 2014
Answer :


Answered By : null Replied Date : Jan 3 2015
Answer :


Answered By : null Replied Date : Jan 8 2015
Answer :


Answered By : null Replied Date : Mar 1 2015
Answer :


Answered By : null Replied Date : Mar 27 2015
Answer :


Answered By : null Replied Date : Jun 14 2015
Answer :


Answered By : null Replied Date : Jul 12 2015
Answer :


Answered By : null Replied Date : Jul 12 2015
Answer :


Answered By : null Replied Date : Jul 18 2015
Answer :


Answered By : null Replied Date : Jul 21 2015
Answer :


Answered By : null Replied Date : Aug 21 2015
Answer :


Answered By : null Replied Date : Aug 25 2015
Answer :


Answered By : null Replied Date : Sep 15 2015
Answer :


Answered By : null Replied Date : Oct 15 2015
Answer :


Answered By : null Replied Date : Dec 25 2015
Answer :


Answered By : null Replied Date : Dec 27 2015
Answer :


Answered By : null Replied Date : Dec 30 2015
Answer :


Answered By : null Replied Date : Dec 30 2015
Answer :


Answered By : null Replied Date : Jan 2 2016
Answer :


Answered By : null Replied Date : Feb 28 2016
Answer :


Answered By : null Replied Date : Apr 18 2016
Answer :


Answered By : null Replied Date : May 12 2016
Answer :


Answered By : null Replied Date : Jul 7 2016
Answer :


Answered By : null Replied Date : Aug 24 2016
Answer :


Answered By : null Replied Date : Aug 25 2016
Answer :


Answered By : null Replied Date : Sep 29 2016
Answer :


Answered By : null Replied Date : Sep 29 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Sep 30 2016
Answer :


Answered By : null Replied Date : Dec 28 2016
Answer :


Answered By : null Replied Date : Dec 30 2016
Answer :


Answered By : null Replied Date : Feb 16 2017
Answer :


Answered By : null Replied Date : Apr 1 2017
Answer :


Answered By : null Replied Date : Jul 26 2017
Answer :


Answered By : null Replied Date : Jul 28 2017
Answer :


 

You can also contribute to this answer:

Your Name:
Answer:

 
Ask Question and get answer from Expert.
View Answers List from Expert.

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy