Apache Wicket reveals internal attributes

I just tried the Apache Wicket "Hello, world" application, and I noticed that in the HTML output, Wicket reveals its internal attributes.

Here's what the rendered HTML looks like in the browser’s “view source":

<html> <body> <span wicket:id="message" id="message">Hello World!</span> </body> </html> 

How do I get rid of the wicket:id="message" attribute in HTML output?

+4
source share
3 answers

Switch to deployment mode , for example. in web.xml :

 <context-param> <param-name>configuration</param-name> <param-value>deployment</param-value> </context-param> 
+11
source

You can place below code in init method if your applciation class

 Application.get().getMarkupSettings().setStripWicketTags(true) 

There was this one if it was not removed in new versions.

+2
source

Also: this parameter is configured at runtime with:

 Application.get().getMarkupSettings().setStripWicketTags(boolean) 
+1
source

Source: https://habr.com/ru/post/1333433/


All Articles