Dynamic markup in Wicket

前端 未结 2 2227
孤独总比滥情好
孤独总比滥情好 2021-02-19 07:53

Is it possible to generate the markup for a MarkupContainer dynamically, i.e. without storing an HTML file for it?

I thought about reading the markup as a p

2条回答
  •  借酒劲吻你
    2021-02-19 08:38

    Another (simpler) way to do it would be to use a label with disabled markup escaping :

    Label label = new Label("id", "foobar");
    label.setEscapeModelStrings(false);
    add(label);
    

    Be careful though, as this might lead to security breaches (HTML/JS injection).

提交回复
热议问题