// extjs send data to the server through post
var conn = new Ext. data. connection ();
Conn. request ({
URL: '/test/ajaxdemo. NSF/agentwebimsendmsg? Openagent ',
method: 'post',
Params: {
fromuseraccount: fromusername,
touseraccount: tousername,
message: encodeuricomponent (Message)
},
Success: function (responseobject ){},
Failure: function (responseobject ){
Ext. msg. Alert ('Failed ', responseobject. statustext );
}
});
// DominoProxy: receives and processes data
sub initialize
on error goto errorhandle
dim session as new notessession
dim curdb as notesdatabase
dim curdoc as notesdocument
dim tdoc notesdocument
dim strformular as string
dim vdata as variant
dim sqry as string
dim sfrom as string
dim sto as string
dim smsg as string
set curdb = session. currentdatabase
set curdoc = session.doc umentcontext
'-- use the domino built-in domain request_content to receive data submitted in post mode
'-- the format of the transmitted data is: fromuseraccount = Zhang San & touseraccount = Li Si & message = Hello
Strformular = "@ urldecode ('domino '; request_content )"
Vdata = evaluate (strformular, curdoc)
Sqry = vdata (0)
Sfrom = webgetparameter (sqry, "fromuseraccount ")
Sto = webgetparameter (sqry, "touseraccount ")
Smsg = webgetparameter (sqry, "message ")
'----------Use Data Information ----------------------
......
Exit sub
Errorhandle:
Msgbox"The error occurs in row "+ CSTR (ERL) +". The error is: "+ error
End sub
// function for obtaining the parameter value
Public Function webgetparameter (byval strsearch $, byval strvar $) as string
const web_arg_sep = "&"
on error goto errors
webgetparameter = ""
dim TMP $, posvar %, possep %
posvar = instr (strsearch, strvar & "= ")
If posvar = 0 Then goto theend
posvar = posvar + Len (strvar) + 1
possep = instr (posvar, strsearch, web_arg_sep)
If (possep = 0) Then
webgetparameter = mid $ (strsearch, posvar)
else
webgetparameter = mid $ (strsearch, posvar, possep-posvar)
end if
theend:
exit function
errors:
webgetparameter = ""
resume theend
end function