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

How to disable scripting?

489


Mention some important jsp action tags.

510


What is the _jspservice() method?

507


Why we use jsp instead of html?

476


Mention the advantages of jsp over pure servlets?

501






Explain the difference between jspwriter and servlet printwriter in jsp?

506


What is the page directive is used to prevent a jsp page from automatically creating a session?

550


List down the major differences between the jsp custom tags and java beans.

477


Can you call jsp from servlet?

518


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

517


Which jsp lifecycle methods can be overridden?

520


What is the use of pagecontext in jsp?

455


How many tags are provided in jstl?

582


How can automatic creation of session be prevented in a jsp page?

548


Differentiate between and <%@include file=…>.

518