• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what should i use

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all
one more silly question..

Hey here i am developing one webapplicaion like student registration create ,delete modify,search ...
and i am using MVC2 architecture ...
so my doubt is while sending the values from servlet to jsp i am using sessions..
am i right?
or what shouyld i need to use..
i think there are 4 types request,application,session,

please will give me real time implementation for this

please answer me...soooon

thanx in advance
cinux
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you shouldn't be using the session to pass data from the Servlet to the JSP for display. You can keep the data in the 'request scope' by using request.setAttribute(...) and then use request.getAttribute(...) in the JSP, since they share the same request.
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Though you can use sessions but in case the the values are not being used through out the session don't use them. In your case it seems that you only require them to be passed amongst the requests. So I would recommend you to use the request scope for your application.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but what happens if i use session..
will there be any performance edgradation??
thanx a lot
cinux
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saikrishna cinux:
but what happens if i use session..
will there be any performance edgradation??
thanx a lot
cinux


Do not use session if you do not required. It will degrade the performance. You can share data between servlets and jsps using request object get and set parameter methods and store your data in JavaBeans.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

but what happens if i use session..
will there be any performance edgradation??


Where do you think session objects live?

They stay in main memory once created and live happily for atleast 30 minutes. So think twice before prefering session scope.
[ February 24, 2006: Message edited by: Vishnu Prakash ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the best qualified scope for that particular work.

Originally posted by Vishnu Prakash:
They stay in main memory once created and live happily for atleast 30 minutes. So think twice before prefering session scope.


Are you serious about 30 mins? I mean, it depends.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I mean, it depends.


Yes, you are correct, that depends. What I said was with respect to Tomcat implementation.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishnu Prakash:


Yes, you are correct, that depends. What I said was with respect to Tomcat implementation.


I guess even with respect to Tomcat it is not fixed. We can change the session time.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I guess even with respect to Tomcat it is not fixed. We can change the session time.


We were talking about default time.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its 60 mins, I guess. Isn't it? Doesn't matter. Whatever.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Its 60 mins, I guess. Isn't it?


Na. It is 30 minutes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic