Hi Experts,
I'm running the upgrade project to EP7.4 from EP7.0. I have replaced with a new class(XSSEncider) the class(StringUtils) that has been deprecated.
StringUtils.escapeToJS --> XSSEncoder.encodeJavaScript
my code
=======================================================================================
INavigationService navigationService = (INavigationService) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY); List arrayListNodes = new ArrayList(); if (level == 0) navigationNodes = getNavNodes(); if (navigationNodes == null) return arrayListNodes;
Iterator iteratorNodes = navigationNodes.iterator();
INavigationNode navigationNode = null;
while (iteratorNodes.hasNext()) { navigationNode = (INavigationNode) iteratorNodes.next();
title = CommonUtil.checkNull(navigationNode.getTitle(this.locale)); if (title.equals("-")) title = parentTitle; else title = title.replaceAll("\r\n", "");
menuPath = StringUtils.escapeToJS(navigationNode.getName());
navigationNode = navigationService.getNode(this.environment, menuPath); . . .
public NavigationNodes getNavNodes () throws Exception { INavigationService service = (INavigationService) PortalRuntime.getRuntimeResources().getService(INavigationService.KEY); NavigationNodes initialNodes = null;
try { initialNodes = service.getInitialNodes(this.environment); } catch (NamingException ne) { ne.printStackTrace(); } return initialNodes; } |
=======================================================================================
reference URL : https://help.sap.com/saphelp_nw70ehp1/helpdata/en/b5/b5b54ba97d4413987252fed5866603/content.htm
Do you have people who have the same experience?
Regards,
Honam