Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning 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

Which one is best?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which one is best in the following method if you want to pass the data across the page?.
1. putting data by using session object
2. putting data by using hidden form fields

can you please give some example?
 
Marshal
Posts: 25969
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't have anything to do with XML. It sounds as if it has something to do with servlets, so I will move it over to the Servlets forum and see if anybody there recognizes it.
 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I like using a session, as it is much easier.

Having said that, in an exam site I have used a number of hidden fields to keep track of which exam a user is taking, as a user could be taking more than one at a time, and I didn't want that duplicated in the session. So, as much as I love sessions, there are places where using hidden fileds makes sense.

I guess this is one of those questions where there are no right answers, and only wrong answers. Whatever your situation is, just try not to get a wrong answer.

Cheers!

-Cameron McKenzie
[ November 09, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sending data from one page to another can be done in two ways depending on the senario.

* If you are planning to retain some date from one page to another and there is a client in between this , then you should consider storing the data in session.

* And if you are planning to retain some date from one page to another and
there is not client in between then its advisible to put data in request scope.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Make Rahul's point more clear:
1: Use session attributes to store data which is user specific.
2: Use hidden fields to store data which is application specific or
module specific.

Regards
Prem
SCJP 1.4, Preparing for SCWCD 1.4
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic