今天在wickt 端遇到怎麼就是收不到vue.js 以post 傳過來的資料
找了好久才發現 application/json 與 application/x-www-form-urlencoded 的不同
前端必須用 application/x-www-form-urlencoded 送, wicket 才收得到
Vue.http.options.emulateJSON = true;

ContentType 為 application/json
Vue.http.options.emulateJSON = false;

在wicket端回傳json 格式時 也要設定ContentType
getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestHandler() {
@Override
public void respond(IRequestCycle requestCycle
) {
//回傳json 格式
((WebResponse) requestCycle.getResponse()).setContentType("application/json");
// Add JSON-encoded string to the response.
Response response = requestCycle.getResponse();
response.write(returnValue);
}
