PDA

View Full Version : Form binding - ignore case on request parameter name


alesj
Mar 21st, 2006, 12:58 PM
What's the easiest way to get your command bean bound with uppercase name params from request?

ex.

My class MCommand has confirmationID field. With normal getter and setter - getConfirmationID() & setConfirmationID(String cID).

How do I get the command object being filled when my param name is ...&ConfirmationID=mc123.

How come it works when whole name is in upper case and getters and setters also.


public int getTARIFFICATIONERROR() {
return tarifficationError;
}

public void setTARIFFICATIONERROR(int tarifficationError) {
this.tarifficationError = tarifficationError;
}

&ConfirmationID=EnPortal12&TARIFFICATIONERROR=2&Price=1000



Rgds, Ales

pmahoney
May 11th, 2006, 06:28 AM
What's the easiest way to get your command bean bound with uppercase name params from request?

ex.

My class MCommand has confirmationID field. With normal getter and setter - getConfirmationID() & setConfirmationID(String cID).

How do I get the command object being filled when my param name is ...&ConfirmationID=mc123.

How come it works when whole name is in upper case and getters and setters also.


public int getTARIFFICATIONERROR() {
return tarifficationError;
}

public void setTARIFFICATIONERROR(int tarifficationError) {
this.tarifficationError = tarifficationError;
}

&ConfirmationID=EnPortal12&TARIFFICATIONERROR=2&Price=1000



Rgds, Ales
Hi Ales
Did you get an answer to your question?
Did you figure out a solution?
I've exactly the same issue :-(
Paul

Colin Yates
May 11th, 2006, 07:25 AM
Quite simply; you cannot. Spring MVC assumes that your backing objects are JavaBeans and the JavaBean spec doesn't allow properties to start with a capital letter.