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

Answers were Sorted based on User's Feedback



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

Answer / asra

<%session.setAttribute("user","Murali");%>

Below statement you can use in any JSP to print the
welcome message. Start using JSP tags to better performance
and better coding.

Welcome to <%=session.getAttribute("user")%>

Is This Answer Correct ?    5 Yes 6 No

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

Answer / vipin

<session.getAttribute(name);>

Is This Answer Correct ?    4 Yes 7 No

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

Answer / faizan samad

String name="faizan";
session.setAttribute("user",name);


String sessionuser=session.getAttribute(name);
out.println("welcome"+sessionuser);
it will display as "Welcome Faizan".

Is This Answer Correct ?    17 Yes 22 No

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

Answer / vilu

HttpSession session = request.getSession(true);

Is This Answer Correct ?    4 Yes 13 No

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

Answer / prasanthi

small correction in answer 1:
session.setAttribute("user",name);
using retrive method
//String sessionuser=session.getAttribute(name);
String sessionuser=(String)session.getAttribute(name);

Is This Answer Correct ?    6 Yes 16 No

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

Answer / vali

hi this is naru

Is This Answer Correct ?    32 Yes 75 No

Post New Answer

More JSP Interview Questions

Can init method be overridden?

1 Answers   IBM,


How do I view a jsp file?

0 Answers  


What is content type in jsp?

0 Answers  


What is tld file?

0 Answers  


What is page scope?

0 Answers  






Why jsp and servlets are used?

0 Answers  


Can I declare a java class in jsp?

0 Answers  


Which one is correct order of phases in jsp life cycle?

0 Answers  


Why do we use jstl tags?

0 Answers  


What are the implicit el objects in jsp?

0 Answers  


difference betwwn 16 bit and 32 bit

0 Answers   Huawei, TechSoft,


What is jsp exception?

0 Answers  


Categories