English 中文(简体)
How to display html text within a Wicket element?
原标题:

i m trying to display html i.e. rich text within a wicket element dynamically. An example is like displaying a rich text email within a div tag. how can i get this done with wicket. the wicket Label component doesn t seem to support this. is there a component that does

最佳回答

Found this in the excellent Manning Wicket in Action:

add(new Label("markup", "<h1>Hello!</h1>").setEscapeModelStrings(false));

The call to setEscapeModelStrings tells Wicket not to escape the contents of the provided string, and to render the contents into the resulting markup. This does the trick, as you can see in the right screenshot in figure 5.4. Note that this setting is available on all Wicket components, but it’s primarily useful on labels.

As the book also notes however, you should be aware of script-injection attacks..

问题回答

暂无回答




相关问题
What PHP framework is most similar to Apache Wicket?

Feature I m looking for is being component based but not event driven. I also like the idea of defining component in his parent code but describing its placement and some visual aspects in the ...

Wicket: how to synchronize requests within session

Scenario: Apache Wicket based web application running on Tomcat server. User opens URL in browser, session is created and simple main page is shown in browser, user clicks on button and AJAX call is ...

Which Java generic should be used in ambiguous cases?

I m having some problems with a Wicket 1.3 -> Wicket 1.4 migration, but this question could be applied to Java generics overall, too. The migration has caused hundreds of warnings to spring up out of ...

How to display html text within a Wicket element?

i m trying to display html i.e. rich text within a wicket element dynamically. An example is like displaying a rich text email within a div tag. how can i get this done with wicket. the wicket Label ...

Problematic Wicket RuntimeException

I m having trouble pinning down the cause of a RuntimeException in a Wicket application. I ve set numerous breakpoints, but none are firing when I submit my form, only when the form is loading. Here ...

How to limit upload file size in Wicket

How to limit file size in uploads in Apache Wicket version 1.4? I am using FileUploadField to handle upload with normal form submit without any Ajax stuff. Is it enough to use Form.setMaxSize() to ...

热门标签