Skip to content

Instantly share code, notes, and snippets.

/* scala template
@import com.example.Document
@(doc: Document)
<h1>Hello @doc.getDocumentTitle !</h1>
*/
/* compiles to*/
package scalatests.html
<!DOCTYPE HTML>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
add(new TransparentWebMarkupContainer("body") {
@Override
protected void onComponentTag(ComponentTag tag) {
tag.append("class", getBodyClass(), " ");
}
});
/* html
<body class="foo" wicket:id="body">
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
...
</html>
import static de.agilecoders.wicket.util.JQuery.$;
@Override
public void renderHead(IHeaderResponse response) {
response.render($(this).chain("modal").asDomReadyScript());
}
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<filtering>false</filtering>
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
try {
// do some work
} catch (Exception e) {
//log stuff
<wicket:panel>
<h3 wicket:id="name"></h3>
<table class="table table-striped instances">
<thead>
<tr>
<th>Host</th>
<th>IP</th>
<th>Last seen</th>
<th>Hawt.io</th>
</tr>
+---------------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------------+--------------+------+-----+---------+----------------+
| fieldName | varchar(255) | NO | | NULL | |
public class MyApplication extends WebApplication {
@SpringBean
private MyBean myBean;
@Override
public void init() {
// this.myBean.doSomething() -> NPE
}
}