Reputation: 2032
how can I change my Html into SafeHtml
Html htmlText = new Html();
htmlText.setText(result.getText());
I am saving a resume in my htmlText, but I want to save it as SafeHtml
how can I convert the above html into safehtml ?
thanks
Upvotes: 3
Views: 7381
Reputation: 897
Take a look at com.google.gwt.safehtml.shared.SafeHtmlUtils
, this class provides utility methods for creating SafeHtml, the simplest way to solve your problem is to use
SafeHtml safeHtml = SafeHtmlUtils.fromString(result.getText());
Upvotes: 5