user1226162
user1226162

Reputation: 2032

how to convert my HTML into SafeHtml in GWT

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

Answers (1)

Swapnil
Swapnil

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

Related Questions