Question

I'm trying to integrate paypal IPN with my Java Struts web application. According to paypal, there are only 2 variables that are posted with IPN across all transaction types, but there are a bunch of other variables that could possibly be posted.

If a post variable is sent that's not in my action form, then struts returns an error about the form not having the property/setter.

IPN has like 300 variables and I really don't want to have a field for all possible ones. Is it possible in struts to accept post variables that my actionForm may not have accounted for?

Was it helpful?

Solution

If you want to use Post Variables which will not be in Struts Form, you should bypass struts form and use simple html form with struts action classes. Some post variable without getter setter in struts form will throw the exception as you specified. So it is better to use HTML form to gain more flexibility. Off course we should write some functionalities for validation and others again for this type of form.

All we want to say that, you can use simple html forms with struts action classes without any issues. We have already done these type of works in our production applications.

Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top