aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session Tracking Mechanisms? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session Tracking Mechanisms?" Watch "Session Tracking Mechanisms?" New topic
Author

Session Tracking Mechanisms?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9381
    
    2

Guys,

How does the hidden field becomes one way to track sessions??


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

It's an old technique to keep the value of a variable between request.
Let's think of an example. You enter your name in a text field, and then press the submit button.
One way ot store the value is to put it in a hidden input field, in the next page, inside a form.
<input type="hidden" name="username" value="Jothi"/>
When you submit again to an other page, your name is sent back again. Your name will be available as long as it is stored in a hidden field.
You can imagine that it is a pain to maintain.


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9381
    
    2

Yes, Satou...it really is a pain to maintain. Thanks for the help!
Vyas
Greenhorn

Joined: May 21, 2007
Posts: 17
you can check for the session thru the request object rather than hidden variable.

Regardless, I could not understand the pain
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Hi Vyas,
welcome to the ranch. You may not be aware of the Javaranch Naming Policy yet. Could you please read it, and change your name accordingly ? Thank you.
http://www.javaranch.com/name.jsp


Regardless, I could not understand the pain

With hidden variables, you would have to keep track of your variables through all pages, which is challenging when you have a lot of input elements.
This was mainly used when session were not available in the old days
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Tracking Mechanisms?