Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | Tags | Help
Query_String value empty with agent URL from xpage 
Hi there,  

I'm developing an application using xpages in domino 8.5.2 running on a windows 2003 server.

My problem is this. I have a xpage on which I added an onload event which calls a client side javascript library.

XSP.addOnLoad(function(){getMyValues()});
 
This function (used for displaying a Fusion Chart swf chart) then calls a lotusscript agent with the fusion charts setDataURL api call. The url contains the agent name and the parameters like "/dbpath/agent?openAgent?val1=?val2=" .The agent returns xml.
 
The problem is that when I test the agent via a browser, I can add the parameters using the "&" sign and this works fine, but from within my xpage, I have to use the "?" sign for the agent to get the Query_String values.

When both val1 and val2 is empty I have no problem as the Query_String value contains all my parameters. The moment I add values to the parameters I get the following error:

2011/02/02 11:09:47 AM  HTTP Web Server: Invalid URL Exception [/myProject/myProject.nsf/ResourceAllocation?openagent?sDate=11/02/01?eDate=11/02/28]
 
I have also tried to change the data to normal string values like sDate=test1?eDate=test2 thinking that the "/" in the value was the problem, but this also gives me the exact same error.
 
What am I missing? Please help.

Thanks
Domino Development / XPages
Corne Roos - about 1 year ago |  |  | Viewed 328 times

There are 3 answers

2votes

The additional "?" characters are the problem. You can only have one in your URL, and that signals the start of the QueryString to the server. Your arguments should then be supplied using the ampersand / equals combination you mention when you test the agent manually. As to why Domino won't permit this format, I'm not sure; perhaps someone else who knows XPages can clarify?



Ben Poole - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


1votes

Ben is absolutely correct, the format of URL you want to be building is ...?openagent&param1=1&param2=2

There is absolutely no issue with this format of URL with XPages.



Matt White - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


1votes

You should be able to use an ampersand to separate the query string values, but if the editor is complaining try using & or & instead.



Andy Cunliffe - about 1 year ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community