• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

When to use session?

 
Ranch Hand
Posts: 172
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all i'm trying to send a request from an html form in which i'l provide emp id, uname, and basic salary amount. I want it to be stored in the salary table which contains empid, uname, b salary, hra, ta,da,gross,pf,net sal. can i use session in which it shoul first calculate vlues and store into database and should redirect the user and display salary slip onto the next page where the calculated amount will be called from a salary table and will be displayed in a desired format? Many thanks!!!
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this article for a discussion of the best practice flow of control in web apps.

The session is sometimes used to preserve the data across a redirect using the PRG pattern, but it's not always the best way. Usually, in the PRG pattern, the data will be re-pulled from the database via the page controller of the redirect target. There usually isn't a need for the session except when it's been proven that caching data in the session solves a demonstrable performance issue.
 
I can't take it! You are too smart for me! Here is the tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic