wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts: Incorrect form submission through javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts: Incorrect form submission through javascript" Watch "Struts: Incorrect form submission through javascript" New topic
Author

Struts: Incorrect form submission through javascript

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

I am submitting my form using javascript.
E.g =>



The content of my deployment descriptor is



Almost all actions are working perfectly as required but the one I am working on right now is NOT. The result is that I get a blank page after I call the javascript function. No errors on the server (tomcat 6) console and none in the log files (both server logs and application logs).

I am stuck neck deep right now. The ways I approached are:-
1) Included alert() statements in the javascript function and all of them are executed (Am on Firefox and no javascript errors are reported).
2) Added breakpoints in the Java code but the server never reaches any of these.
3) The log files show that the form bean corresponding to this particular form is been instantiated.
4) The log files also says that its looking for the associated action and returning the existing Action instance and stops.
5) The page goes white and the whole application stops.

Anyone has any suggestions on how I should take this one?

Cheers,
Raj.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Add more logging, or fire up the debugger--there's not enough information to help. Make sure logging is at DEBUG level.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1


Thanks,

The debugger is already on DEBUG level. Since you mentioned logging, I had checked the logger level and it already was on DEBUG. Let me elaborate a little, This happens at a certain step in a flow. Say there are a few steps prior to this. I use Struts1.x/Java5/Hibernate/Tomcat6/MySQL on my application. All the steps involve interaction with the Db. But there are no transactions included. I am trying to figure out an approach which I could employ out here.
Thanks,
Raj.



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you using Tiles?
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1



Yes David Tiles is being used but not extensively. The basic layout of the page is via tiles but I am not sure to what extent. I can see Tiles TLDs included in pages but not the tags for the same.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Tiles is notorious for swallowing exceptions-I'd look into the page first. You could subclass the request processor and add more logging if you truly *know* none of your action code is being executed.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1



That sure sounds like a good way to approach it but I regret to inform you that time is a major constraint right now and keeping that in mind I worked out a solution. This certainly is not a good way but I re-did the whole thing from a previous version and lo and behold, this time around all went fine. Thanks for the tip on Tiles and all the others as well.

Thank you David
 
 
subject: Struts: Incorrect form submission through javascript