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

Answer Posted / mayur patel

start session oject in jsp.

first u set using following methods
String name="Mayur4453";
session.setAttribute("user",name);

using retrive method
String suser=session.getAttribute("user");**
out.println("Hi. . !! welcome "+suser);

Is This Answer Correct ?    19 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you know about jsp tags? Explain how you understand the action tag and jsp action elements.

569


Why use of scripting elements in jsp is discouraged?

542


What class.forname will do while loading drivers?

532


Can we use jstl in html?

459


Which directive is used in jsp custom tag?

519






What is jsp api?

480


Give an example of using your own tags.

515


How clear chache and buffer of opera browser.

1935


What are the two ways to include the result of another page?

1839


what is the difference between jsp and servlets ?

563


How session is achieved in JSP?(once user logs out,if he press back button of browser he should not be allowed to same page)

2006


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

517


Why are jsp pages preferred for creating web-based client program?

525


What is the purpose of creating custom tags?

527


How can the output of JSP or servlet page be prevented from being cached by the browser?

499