File "renaming_map.properties":
text=a
red=b
blue=c
title=e
news=d
--------------------------------------------------------------
File "PropRenamingMap.java":
public class PropRenamingMap implements SoyCssRenamingMap {
private Properties properties = new Properties();
public PropRenamingMap() throws IOException {
File file = new File(
"./renaming_map.properties");
InputStream in = new FileInputStream(file);
if (in != null) {
properties.load(in);
}
in.close();
}
@Override
public String get(String key) {
String out = properties.getProperty(key);
return (out == null ? key : out);
}
}
--------------------------------------------------------------
File "test.jsp":
<%
SoyCssRenamingMap props = new PropRenamingMap();
%>
<%=tofu.newRenderer(NewsSoyInfo.WRAPPER).setMsgBundle(msgBundle)
.setCssRenamingMap(props)
.setData(new SoyMapData(NewsSoyInfo.WRAPPER.NEWS,new
SoyListData())).render()%>
as result page contains "full" css name:
news-title,news-text,... but not short name d-e, d-a,...
How to solve this problem?