如何在wicket框架中呈现<base />标记

时间:2016-11-08 20:13:29

标签: java wicket

使用wicket框架渲染基本标记的方法有哪些?

在JSP中,我可以这样做:

<base href="${pageScope.contextPath}/" />

1 个答案:

答案 0 :(得分:5)

在YourPage.html中:

<head>
   ...
   <base wicket:id="base"/>
   ...
</head>

在YourPage.java中:

WebComponent base = new WebComponent("base");
add(base);
base.add(new AttributeModifier("href", "<the url>"));
相关问题