how to maintain sessions in jsp?can you tellme the methods.

Answer Posted / godfather

String str="xxx";
session.setAttribute("xxx",str);//to set session
//so nw the session will get store by the name "xxx".

//To retrieve session

String str1=session.getAttribute("xxx");

Is This Answer Correct ?    14 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?

529


Why do we need custom tags?

504


Why jsp is faster than servlet?

500


What are page directives?

526


What are the primary differences between the jsp custom tags and java beans?

529






What are request and response objects?

520


Which is better jsp or javascript?

507


Define scriptlet, expression and declaration in jsp?

512


What is jsp-config in deployment descriptor?

597


what is the difference between jsp and servlets ?

570


Which jsp life cycle is in correct order?

517


What is JTGrid?

1983


What are the implicit objects in jsp?

521


Why does _jspService() start with an ‘_’ but other lifecycle methods do not?

552


What is scriptlet tag in jsp?

498