Amazon deals

Wednesday, October 22, 2008

Xforms submission giving null parameters to request.getparameter() - Solution

Simplicity side of X-forms and xml apart, when one goes building any major web app from the very little, itsy bitsy knowledge we have, looms large problems that shake the very fundamentals of what you began coding with. If you ever tried the previous Xform in a debug mode on the Websphere server you would have found out now the hard way that the form does pass values, but jsp page cannot recognise in whatsoever.  Its an irksome problem i had last night and spent around 6 hours of my valuble time figuring out, going through over 1000 links on google and reading over 10 pdfs, to know there isn'at a solution posted anywhere. Ok fine leave apart my difficulties, here's what you came for, the solution to the problem

 

Goto your submission element

<xf:submission action=”process.jsp”
method=”get” id=”sub”/>


add an extra parameter

<xf:submission action=”process.jsp”
method=”get”
seperator="&amp;" id=”sub”/>

voila, you have your parameters now.

Now, the exact reason why the problem occured:

An html form uses the seperator by default and a jsp seperates out and creates a parameter map from this. Xforms by default, doesn't specify the standard seperator, so the addition tag required in the submission element in your model.

No comments:

Post a Comment