1 5 6 13 package org.exoplatform.services.portletcontainer.impl.portletAPIImp.utils; 14 15 public class CustomRequestWrapperUtil { 16 17 private static final char SEPARATOR = '$'; 18 19 public static String decodeRequestAttribute(String windowId, String attributeName) { 20 if (attributeName.startsWith(windowId + SEPARATOR)) { 21 int index = attributeName.indexOf(SEPARATOR); 22 if (index > -1) { 23 attributeName = attributeName.substring(index + 1); 24 } 25 } 26 return attributeName; 27 } 28 29 public static String encodeAttribute(String windowId, String attributeName) { 30 if(attributeName.startsWith("javax.")) 31 return attributeName; 32 StringBuffer sB = new StringBuffer (); 33 sB.append(windowId); 34 sB.append(SEPARATOR); 35 sB.append(attributeName); 36 return sB.toString(); 37 } 38 39 } 40 | Popular Tags |