I'm just starting off with this IPN, trying to incorporate it with struts (like znaps...). In case you didn't figure it out, JSPs are actually servlets, or at least at run-time they get converted into servlets. So on that count, it doesn't matter where you put the IPN code.
However since you are using struts, I would recommend doing the following. If anyone knows better, please correct me.
Set up an action mapping for your chosen URL (e.g.
www.mysite.com/testipn.do) like so:
<action path="/testipn"
type="com.mysite.payments.ProcessIPN">
</action>
This will tell the struts servlet to call your 'ProcessIPN' class (just made that class name up), in which you should put the IPN code. You are using struts v1.1 right?
The ProcessIPN class should extend org.apache.struts.Action and your execute method should contain the code.
In the if...else blocks at the end of the code, you need to write code to do what the comments tell you to do.
The execute() method should return Null, because after you have processed the IPN, there is nothing more to do, no displaying or HTTP response necessary.
Znaps, does this all make sense, what I'm saying?
Adam
I want to feel your sweet embrace
But don't take that paper bag off of your face