内容简介:翻译自:https://stackoverflow.com/questions/3933921/generating-commented-out-content-with-wicket
注释中.
输出将是……
<!-- <div wicket:id="foo"> 1234 </div> -->
…其中“1234”是一些有趣的,动态创建的信息.
我试过,但无济于事:
><! -<div wicket:id =“foo”></ div> – > →Wicket抱怨HTML页面中缺少id为“foo”的元素
>封闭在<wicket:remove> →此类部分不能包含带wicket的元素:id
> label.setVisible(false)→Wicket根本不输出标签
> new Label(“foo”,“<! - ”foo“ - >”)→ 逃脱和>
那么,你可以用Wicket(轻松)做到这一点,还是我应该忘掉它?
这个怎么样?
class CommentOutModifier extends AbstractBehavior {
private static final long serialVersionUID = 1L;
@Override
public void beforeRender(Component component) {
component.getResponse().write("<!--");
}
@Override
public void onRendered(Component component) {
component.getResponse().write("-->");
}
}
add(new Label("tohide", "Hi, can you see me?").add(new CommentOutModifier()));
然后,放:
<span wicket:id="tohide"></span>
在您的标记中将产生:
<!--<span>Hi, can you see me?</span>-->
翻译自:https://stackoverflow.com/questions/3933921/generating-commented-out-content-with-wicket
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Designing Data-Intensive Applications
Martin Kleppmann / O'Reilly Media / 2017-4-2 / USD 44.99
Data is at the center of many challenges in system design today. Difficult issues need to be figured out, such as scalability, consistency, reliability, efficiency, and maintainability. In addition, w......一起来看看 《Designing Data-Intensive Applications》 这本书的介绍吧!
CSS 压缩/解压工具
在线压缩/解压 CSS 代码
正则表达式在线测试
正则表达式在线测试