domino代理通过Request_Content域接收extjs以post方式提交的数据
// extjs通过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('失败', responseObject.statusText);
}
});
//domino代理:接收并处理数据
Sub Initialize
On Error Goto ErrorHandle
Dim session As New notessession
Dim curdb As NotesDatabase
Dim curdoc As notesDocument
Dim tdoc As NotesDocument
Dim strFormular As String
dim vData As 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.documentContext
'--使用domino内置域Request_Content接收post方式提交的数据
'--传送数据格式为:fromUserAccount=张三&toUserAccount=李四&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")
'----------使用数据信息----------------------
... ...
Exit Sub
ErrorHandle:
Msgbox "错误发生在第"+Cstr(Erl)+"行, 错误是: "+Error
End Sub
//得到参数值的函数
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