Thursday, February 25, 2010
02-25-2010
Will finish up the LMS field mapper application for Ben. Found that I could use Spring's Rest Template to post to the LMS server. I then tried redirecting the "verify the data before posting to FiServ" screen to a method on the LmsController which looks at the desired data format type and redirects the browser to either /lms.xml or /lms.csv. There is a problem, of course. The data bean that is poplated initially has all the correct values. I was hoping that the very same instance would also get passed into the next method in the calling sequence. That does not appear to be the case. Only the data that is actuall part of the form is getting transmitted back to the server. It looks like I need to capture the data from the bean and send it as part of the form as a hidden field. Hopefully, that will allow the state to be properly transferred between the view and the controller. Got that working but now we have another problem. The idea is to use Spring to return the same content in different forms, XML vs CSV. This is done using a combination of @ResponseBody and the methods return type. The issue is that I have been unsuccessful in calling the correct end point based on desired format. Forwarding/redirecting from within the controller does not work. In the case of a forward, I end up in an infinite, recursive loop. In the case of a redirect, the posted information is lost. Seems like the decision has to be made on the view side -- yuck! Ben suggests using JavaScript to modify the DOM so that the data will get posted to the correct end point. We shall see.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment