The Domino proxy receives data submitted by extjs in post mode through the request_content domain

Source: Internet
Author: User
Tags in domain

// 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.