This week's book giveaway is in the NodeJS forum.
We're giving away four copies of Serverless Applications with Node.js and have Slobodan Stojanovic & Aleksandar Simovic on-line!
See this thread for details.
Win a copy of Serverless Applications with Node.js this week in the 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
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Struts 1.0 : When does the action form constructor get called ?  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am maintaining a Struts 1.0 application. I have a session scoped form that gets its default constructor called when I do a GET on a action to display it initially. From there on assuming that the user limits itself to using the forms buttons and controls all calls are POSTS.
But if I go to the address bar and  press the enter key, the default constructor doesn't get called. What is the difference of following a link (a href) to the action and loading it from the address bar ? The former calls the default constructor while the latter doesn't. Since the form is session scoped that kind of explains it, but if i leave the form through a javascript window.location to another page, when I get back in, the constructor gets called again. Shouldn't it be in the session ?

Thanks
 
Daniel Luis dos Santos
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My rubber duck just told me. The constructor is being called because in the page before entering the form you are setting it to null.

Question answared
 
I've never won anything before. Not even a tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!