I am at a loss. I am trying to do a simple ajax post to an action bean using jquery. I have followed Freddie's book example using partial forms because I have to insert a select tag inside an existing form. I couldn't get that to work so I looked at several online examples. I had another developer look at my code who has Ajax experience and he said it looked fine. But it's not fine.
In my eclipse debugger, I can see in context.request.parameterMap that my data is there in the correct object:
contractTerms.executionMonth=[G2006]
But when I look at the object on the action bean I see this:
BdQBDxuw1FmzhjnwVnB14JwdSNs= this value changes every time I run it.
What is that? Obviously my query fails as there is no such value in my database. I suspect I am missing some simple fundamental element, but I can't see it. Doesn't stripes read the values from the parameterMap? If not, where does it read from? Is JQuery doing this to my object? How do I correct it?
my Ajax looks like this:
function findStrikePrices(field) {
var form = field.form;
var params = $(form).serialize() + '&_eventName=' + 'findStrikePrices';
$.post(form.action, params,
function(data) {
$('#priceList' ).html(data);
}
);
return false;
}
The select tag in my
jsp looks like this:
<s:select name="contractTerms.executionMonth" id="executionMonth">
<s:option selected="true" value="">
<fmt:message key="monthList.selectAMonth"/>...
</s:option>
<c:forEach items="${actionBean.executionMonths}" var="month">
<s:option value="${month}">${month}</s:option>
</c:forEach>
</s:select>
The variable on my action bean is defined like this:
private ContractTerms contractTerms = new ContractTerms();
executionMonths is defined in ContractTerms:
private String executionMonth;
I have spent a lot of time debugging, rewriting, and running with both JQuery and Prototype and I just don't understand why this is failing. Any help would be greatly appreciated. I will be happy to send additional code if needed.
I am not having fun at this point. I thought Stripes was going to make Java fun again? ;-)