XPages URL CheatSheet

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


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://cheatsheet.notesin9.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://cheatsheet.notesin9.com/cheatsheet.nsf/url.xsp
var url =  context.getUrl() context.getUrl();
url.removeAllParameters();
return url
http://cheatsheet.notesin9.com/cheatsheet.nsf/url.xsp
database.getFilePath() cheatsheet.nsf
context.getUrl().toString().split(view.getPageName())[0] http://cheatsheet.notesin9.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://cheatsheet.notesin9.com/cheatsheet.nsf/url.xsp
context.getUrl.getPath() /cheatsheet.nsf/url.xsp
context.getUrl.getAddress() http://cheatsheet.notesin9.com/cheatsheet.nsf/url.xsp
context.getUrl().getHost() cheatsheet.notesin9.com
context.getUrl().getSiteRelativeAddress(context) /url.xsp
Base URL context.getUrl().getAddress().replace(view.getPageName(), '') http://cheatsheet.notesin9.com/cheatsheet.nsf
User Agent var uAgent = context.getUserAgent().getUserAgent(); CCBot/2.0 (https://commoncrawl.org/faq/)
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@e8dadcd1, com.sun.faces.ApplicationAssociate=com.sun.faces.application.ApplicationAssociate@1801053, deviceBean=com.ibm.xsp.extlib.beans.DeviceBean@77c87fbd, javax.servlet.context.tempdir=/Partitions/flyers.notesin9.com/xsp/cheatsheet.nsf} Map containing the application scope values
cookie {} Map containing the cookies for the current request
facesContext com.ibm.xsp.domino.context.DominoFacesContext@95ba7d59 The FacesContext instance for the current request
header {User-Agent=CCBot/2.0 (https://commoncrawl.org/faq/), If-Modified-Since=Mon, 29 May 2023 12:28:18 GMT, Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, Accept-Language=en-US,en;q=0.5, Connection=Keep-Alive, Accept-Encoding=br,gzip, Host=cheatsheet.notesin9.com} Map containing the HTTP header values for the current request
headerValues {Connection=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@43f7efff, Accept=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@a1314517, Accept-Encoding=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@64ab7822, Host=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@56cc6de5, Accept-Language=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@cdb0816, User-Agent=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@c36604d3, If-Modified-Since=com.ibm.domino.xsp.bridge.http.util.SingleValueEnumeration@2539483f} 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 {} Map containing the request parameters for the current request
paramValues {} Map containing arrays which contain the parameter values for request parameters for the current request
requestScope {__xspconvid=null, componentParameters=com.ibm.xsp.application.ComponentParameters@4e5aee17, bluemixContext=com.ibm.xsp.bluemix.util.context.BluemixContext@e9160c06, com.ibm.xsp.SESSION_ID=F612743DDF5B95DF3F82FBB08319589A6DF7AA8E, com.sun.faces.INVOCATION_PATH=.xsp, cookie={}, extlib.device.deviceBeanData=com.ibm.xsp.extlib.device.impl.DeviceImpl@346cb2f9, session=CN=Flyers/O=Ni9, com.sun.faces.FORM_CLIENT_ID_ATTR=view:_id1, context=com.ibm.xsp.designer.context.ServletXSPContext@9324f3f7, database=cheatsheet.nsf} Map containing the request attributes for the current request
sessionScope {xsp.sessionData=com.ibm.xsp.designer.context.PersistentSessionData@b07c3167, __notescontext_publicaccess=com.ibm.domino.xsp.module.nsf.NotesContext$AccessPrivileges@786d1d39, xspIsBot=false} Map containing the session attributes for the current request
view com.ibm.xsp.component.UIViewRootEx2@74e07798 UIViewRoot of the current component tree
viewScope {} Map containing the view scope values
context com.ibm.xsp.designer.context.ServletXSPContext@9324f3f7 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