Tuesday, March 9, 2010

Query String in XPages

Assuming that you pass parameters to xpages as indicated in the following link....

http://xyz.com/abc.xsp?solo="polo"

To retrieve or extract parameters.

var externalContext=facesContext.getExternalContext();
var servletRequest=externalContext.getRequest();
var queryString=servletRequest.getQueryString();
return queryString

it will return solo=polo.

You can also perform the following operation
.

var exCon = facesContext.getExternalContext();
var request = exCon.getRequest(); // This is the actual HTTP servlet request...
var paramValue = request.getParameter("paramName");
return paramValue;

it will return polo.

2 comments: