Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Stripes not getting value from form field

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:


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"/>...
<c:forEach items="${actionBean.executionMonths}" var="month">
<s:option value="${month}">${month}</s:option>

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? ;-)
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!