XPages URL CheatSheet

Content Code Result
Host Only return context.getUrl().toString().split(facesContext.getExternalContext().getRequest().getRequestURI())[0] http://xpagescheatsheet.com
Host with DB return context.getUrl().toString() http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp?test=1
Database file Name @LeftBack(database.getFileName(),".nsf") cheatsheet
get QueryString return facesContext.getExternalContext().getRequest().getQueryString() test=1
get QueryString 2 return context.getUrl().getQueryString() ?test=1


Content Code Result
Current Path facesContext.getExternalContext().getRequest().getContextPath() /cheatsheet.nsf
Full Path With Page facesContext.getExternalContext().getRequest().getRequestURI() /cheatsheet.nsf/url.xsp
Full URL facesContext.getExternalContext().getRequest().getRequestURL() http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp
var url:XSPUrl = new XSPUrl(database.getHttpURL());
var result = url.getHost()
return result
flyers.notesin9.com
XSPUrl.getAddress http://flyers.notesin9.com/__852579C40075620B.nsf
XSPUrl.getFragment
XSPUrl.getPath /__852579C40075620B.nsf
XSPUrl.getPort -1.0
XSPUrl.getSiteRelativeAddress -1.0
User Name session.getEffectiveUserName() Anonymous
Common Name var uName:NotesName = session.createName(session.getEffectiveUserName())
return uName.getCommon()
Anonymous
facesContext.getExternalContext().getRequest().getContextPath() /cheatsheet.nsf
@ReplaceSubstring(database.getFilePath(), '\\', '/'); cheatsheet.nsf
Page Name view.getPageName() /url.xsp
view.getPageBaseURL()
@FullUrl("myPage") /cheatsheet.nsf/myPage
Full URL and Page context.getUrl() http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp?test=1
var url =  context.getUrl() context.getUrl();
url.removeAllParameters();
return url
http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp
database.getFilePath() cheatsheet.nsf
context.getUrl().toString().split(view.getPageName())[0] http://xpagescheatsheet.com/cheatsheet.nsf
facesContext.externalContext.requestContextPath()
facesContext.getExternalContext().getRequest().getContextPath() + "?Logout&redirect=http://www.yahoo.com" /cheatsheet.nsf?Logout&redirect=http://www.yahoo.com
Get the Protocol url = context.getUrl();
return url.getScheme();
http
context.getUrl().toString() http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp?test=1
context.getUrl.getPath() /cheatsheet.nsf/url.xsp
context.getUrl.getAddress() http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp
context.getUrl().getHost() xpagescheatsheet.com
context.getUrl().getSiteRelativeAddress(context) /url.xsp
Base URL context.getUrl().getAddress().replace(view.getPageName(), '') http://xpagescheatsheet.com/cheatsheet.nsf
User Agent var uAgent = context.getUserAgent().getUserAgent(); Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
iOS8 false

deviceBean.isIPhone() false
deviceBean.isiPad() false
deviceBean.isMobille() false
deviceBean.isTablet() false
deviceBean.getVersion('ipad')
deviceBean.getVersion('apple')
deviceBean.isApple() false
deviceBean.getValue("ipad") false
iOS 8 Not iOS



this is a test/cheatsheet.nsf
/cheatsheet.nsf/url.xsp


=====
Name String Value Description
applicationScope {com.sun.faces.OneTimeInitialization=com.sun.faces.OneTimeInitialization, com.sun.faces.HTML_BASIC=com.ibm.xsp.renderkit.ReadOnlyRenderKit@36d96291, javax.servlet.context.tempdir=/Partitions/flyers.notesin9.com/xsp/cheatsheet.nsf, deviceBean=com.ibm.xsp.extlib.beans.DeviceBean@6607940a, com.sun.faces.ApplicationAssociate=com.sun.faces.application.ApplicationAssociate@db2284ed} Map containing the application scope values
cookie {} Map containing the cookies for the current request
facesContext com.ibm.xsp.domino.context.DominoFacesContext@19dccdb4 The FacesContext instance for the current request
header {Accept=*/*, X-Forwarded-For=10.1.193.132, User-Agent=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com), Host=xpagescheatsheet.com, Via=1.1 squid-proxy-5b5d847c96-jmspt (squid/6.13), Connection=keep-alive, Accept-Encoding=gzip, br, zstd, deflate, Cache-Control=max-age=0} Map containing the HTTP header values for the current request
headerValues {X-Forwarded-For=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@52147fec, User-Agent=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@5181304a, Connection=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@69cad0a1, Cache-Control=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@1cffce3e, Accept=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@bd145996, Via=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@b8105898, Host=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@50762167, Accept-Encoding=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@ce10b6a7} Map containing arrays which contain the header values for the HTTP headers for the current request
initParam {com.ibm.xsp.SHARED_CONFIG=true, xsp.library.extra=com.ibm.xsp.extlib.library, com.sun.faces.verifyObjects=false, com.sun.faces.forceLoadConfiguration=true} Map containing the initialization parameters for the web application
param {test=1} Map containing the request parameters for the current request
paramValues {test=[Ljava.lang.String;@e60ec901} Map containing arrays which contain the parameter values for request parameters for the current request
requestScope {__xspconvid=null, bluemixContext=com.ibm.xsp.bluemix.util.context.BluemixContext@640c8c7f, com.sun.faces.INVOCATION_PATH=.xsp, database=cheatsheet.nsf, com.ibm.xsp.SESSION_ID=E5ECDF3C4E98A3FDA65813A62FB6383647FCEEC9, cookie={}, extlib.device.deviceBeanData=com.ibm.xsp.extlib.device.impl.DeviceImpl@53c8be7d, componentParameters=com.ibm.xsp.application.ComponentParameters@7583671b, session=CN=Flyers/O=Ni9, com.sun.faces.FORM_CLIENT_ID_ATTR=view:_id1, context=com.ibm.xsp.designer.context.ServletXSPContext@a98c5f9e} Map containing the request attributes for the current request
sessionScope {xsp.sessionData=com.ibm.xsp.designer.context.PersistentSessionData@5588cb4, __notescontext_publicaccess=com.ibm.domino.xsp.module.nsf.NotesContext$AccessPrivileges@3220e101, xspIsBot=false} Map containing the session attributes for the current request
view com.ibm.xsp.component.UIViewRootEx2@30758ff1 UIViewRoot of the current component tree
viewScope {} Map containing the view scope values
context com.ibm.xsp.designer.context.ServletXSPContext@a98c5f9e The XspContext instance for the current request
database cheatsheet.nsf The Database instance for the current request
session CN=Flyers/O=Ni9 The Session instance for the current request
sessionAsSigner CN=Flyers/O=Ni9 The Session instance with the credentials of the XPage signer
sessionAsSignerWithFullAccess CN=Flyers/O=Ni9 The Session instance with the credentials of the XPage signer and with full administratice access