本文整理匯總了Java中org.springframework.web.util.HtmlUtils.htmlUnescape方法的典型用法代碼示例。如果您正苦於以下問題:Java HtmlUtils.htmlUnescape方法的具體用法?Java HtmlUtils.htmlUnescape怎麽用?Java HtmlUtils.htmlUnescape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.web.util.HtmlUtils
的用法示例。
在下文中一共展示了HtmlUtils.htmlUnescape方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: unescape
import org.springframework.web.util.HtmlUtils; //導入方法依賴的package包/類
public static String unescape(String html){
if(html == null){
return null;
}
return HtmlUtils.htmlUnescape(html);
}
示例2: createMessage
import org.springframework.web.util.HtmlUtils; //導入方法依賴的package包/類
private MimeMessage createMessage(String subject, String text) throws MessagingException {
// create a message
subject = HtmlUtils.htmlUnescape(subject);
text = HtmlUtils.htmlUnescape(text);
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
InternetAddress address = new InternetAddress(receiver);
msg.setRecipient(Message.RecipientType.TO, address);
msg.setSubject(subject, "UTF-8");
msg.setSentDate(new Date());
msg.setText(text, "UTF-8");
return msg;
}
示例3: unescape
import org.springframework.web.util.HtmlUtils; //導入方法依賴的package包/類
public static String unescape(String content){
return HtmlUtils.htmlUnescape(content);
}
示例4: transformValue
import org.springframework.web.util.HtmlUtils; //導入方法依賴的package包/類
/**
* Transforms the given value.
*
* @param key The key associated with the value being transformed.
* @param value The value to be transformed.
* @return The transformed value.
*/
protected String transformValue(String key, String value) {
return HtmlUtils.htmlUnescape(value);
}
示例5: decode
import org.springframework.web.util.HtmlUtils; //導入方法依賴的package包/類
/**
* HTML decodes the given string.
*
* @param input The string to be decoded.
* @return The decoded string.
*/
public static String decode(String input) {
if (input == null) return null;
return HtmlUtils.htmlUnescape(input);
}