This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts form values getting blanked out on submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts form values getting blanked out on submit" Watch "Struts form values getting blanked out on submit" New topic

Struts form values getting blanked out on submit

Jason Stull
Ranch Hand

Joined: Feb 02, 2004
Posts: 47
Hi All,
We are scratching our heads over a strange problem that has arisen since our last deployment to Struts running in JBoss 3.08 w/ Jetty over HTTPS. Some of the forms submitted by our clients are getting wiped out after getting to the server. Meaning someone types in their name hits the submit button, then Struts looks up the form in the session, then calls the validate method. At this point all the name fields in the form bean are blank! This is especially frustrating because it only happens with certain web browsers and for those web browsers it happens every time. And of course these folks had no trouble at all before the deployment. We've been around and around and can't figure out if the problem is on the server or client side. Things changed at our last deployment include:
1. Upgrading VM to j2sdk1.4.2_03 from j2sdk1.4.2
2. Using one course grained form bean as opposed to several fine grained ones.
*all these changes went without a hitch in testing
That's pretty much it. I'd love to take the blame and say it's a bug in our business logic, but things seem to be getting mucked up in the Struts framework before it gets to our business code.
Any ideas or comments would be much appreciated. I'm running out of hair :-)

"I believe in coyotes and time as an abstract Explain the change the difference between What you want and what you need there's the key"
Emilio Butrage´┐Żo

Joined: Mar 05, 2004
Posts: 8
Check for the presence of any filters that intercept the request before they reach Struts. Examine your web.xml closely. Good luck
Srikanth Shenoy
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Certain browsers submit duplicate requests especially you are basing your form submission on a <a href.... > and JavaScript
Srikanth Shenoy
Author: Struts Survival Guide - Basics to Best Practices

Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
I agree. Here's the link:
subject: Struts form values getting blanked out on submit
It's not a secret anymore!