GWT: Putting raw HTML inside a Label

后端 未结 5 2681
情深已故
情深已故 2021-02-20 08:26

Is there a way to put raw HTML inside of a Label widget with GWT? The constructor and setText() methods automatically escape the text for HTML (so

5条回答
  •  你的背包
    2021-02-20 08:46

    Use the HTML class (Or more likely: The InlineHTML class instead of the Label class. InlineHTML works like label, except that you can give it html.

    And just a security warning: if part of the input to your InlineHTML object is input by the user, remember to strip html out of that part, so users can't insert their own scripts into your code.

提交回复
热议问题