I have used the below code to get the currentpagepath in modal but if I use same code in service it is not working nd currentpage value I am getting null. Can anyone help on this.
@ScriptVariable
protected Page currentPage;
public string getCurrenPath() {
String currentPagePath = currentPage.getPath();
return currentPagePath;
}