| Apache Wicket > Framework Documentation > Reference library > How to do things in Wicket > Configuration > Use a different extension for template files |
| For Wicket 1.2.x users The Wicket 1.2.x version |
To accomplish this you need to override the WebPage.getMarkupType()
method in your page class.
For instance, the default:
public String getMarkupType() { return "html"; }
can be overridden to be something like:
public final String getMarkupType() { return "xhtml"; } protected final void configureResponse() { super.configureResponse(); getResponse().setContentType("text/html"); }
See the source code for the Alternative Markup (XML)
example for a more complete demonstration of this concept.