QueryString issue with XPages

I’m working on Xpages update of an existing application. As a result, I need to support old URL patterns. However, I cannot get the full query string from a URL like http://myservers/somepath/myapp/view/keyofdoc?open&filter=a.

I tried a lot of variations e.g. facesContext.getExternalContext().getRequest().getQueryString() but it always returns a translated URL with documentId and action. Also tried context.getUrl().getQueryString() but similar result.

Does anyone know how to get to the input URL and especially a parameter after the &amp. I never seem to get hold of it. Is it because I load an XPage when the form is opened?

Subject: Try this…

#{javascript:context.getUrlParameter(“filter”);}

This should return the “filter” QueryString Parameter value.

This might also be helpful:

A Guide to Field Pre-population for IBM Lotus Notes Domino Web Apps

@

HTH,

-Chris

Subject: Some more info

Chris, tx for the info but it doesn’t seem to work.

As I explained, when a form is opened, I open an Xpage and my impression is that the info is translated into some standard parameters and others are discarded. This is an example:

This is my original URL (pub is the view and root is a subsition URL to construct friendly URLs):

http://hostname/root/pub/BEGF-7CQC9C?open&filter=lotus

However, this is what you get on the server when the XPage is rendered:

HTTP JVM: context.getUrlParameter(“filter”): HTTP JVM: facesContext.getExternalContext().getRequest().getQueryString(): documentId=70A38753161CA8D3C12577120052CE82&action=openDocument

HTTP JVM: facesContext.getExternalContext().getRequest().getRequestURL(): http://hostname/xpages/dw-index.nsf/blog-view.xsp

As you can see, the context is completely different at the time I run the code (at top of an Xpage). It seems that I have lost the original context because of something the server has done in parsing the request to the XPage servlet.

A workaround could be to write a webqueryopen agent that reformats my input URL into an actual xsp syntax instead of loading the xpage automatically when the form is opened.