Simple rendering introduction to html
public static String render(String pHtmlTemplate, final Map pModel) { PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}"); String result = placeholderHelper.replacePlaceholders(pHtmlTemplate, new PlaceholderResolver() { @Override public String resolvePlaceholder(String placeholderName) { return Objects.toString(pModel.get(placeholderName), ""); } }); return result; }
##The above method returns an html carrying data, so Front-end js does not need to wait for ajax data before rendering. Note: There is a sentence
1 propVal = parseStringValue(propVal, placeholderResolver, visitedPlaceholders);
The above is the detailed content of Simple rendering introduction to html. For more information, please follow other related articles on the PHP Chinese website!