cannot post "+" to server

cannot post "+" to server


in my demo.js:
function postData(cmd){
$.ajax({
type: "POST",
url: "variable.cmd",
data: "cmd=" + cmd,
success: function(msg){
}
});
}
function testSubmit(){
postData("1+2");
}
in my servlet:
String data = getRequest().getParameter("cmd");
System.out.println(data)
OUTPUT is :
1 2
which means "+" is replaced by a space..