• Post Reply Bookmark Topic Watch Topic
  • New Topic

pass value jsp to servlet using session  RSS feed

 
mohammad shadab
Ranch Hand
Posts: 54
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a jsp file in which i am setting attributes value in the session and file_full_path and patient_id are two variables which holds some value.now i want to get this value in my servlet.how can i get these both there???
<%
session.setAttribute("full_path",file_full_path);
session.setAttribute("patient_id", patient_id);
%>
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the session from the request reference that is available in your servlet


 
mohammad shadab
Ranch Hand
Posts: 54
Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E Armitage wrote:You can get the session from the request reference that is available in your servlet





ok i will try.i was confused how it will get that id which is generated in jsp???
 
Ishan Pandya
Ranch Hand
Posts: 228
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the servlet Specification 3.0 which says :


Any object bound into a session is available to any other servlet that belongs to the same ServletContext and handles a request identified as being a part of the same session.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!