This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

what should i use

 
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
 
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.
 
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
 
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.
 
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 ]
 
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic