@vijitha, No other way you need to update you Service and Sling Models. Better get the current page path in Sling Model and passing it as an argument to your service and update your Service accordingly.//Service
String getLinkItem(final String url, final boolean isFragment,String pagePath) {
...
}
...