本文整理汇总了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);
}