0
我使用CSS樣式的左側菜單在Wicket中開發了一個應用程序。一切正常。然後,爲了使URL成爲RESTful,我將WicketApplication.java
更改爲使用MixedParamUrlCodingStrategy
。從那時起,風格停止工作。我不知道問題出在哪裏。我沒有改變任何東西。這裏是我的代碼:實現MixedParamUrlCodingStrategy可以防止我的網站使用CSS
mount("/site",PackageName.forPackage(WelcomePage.class.getPackage()));
//
mount("/download",PackageName.forPackage(AppDownloadApi.class.getPackage()));
// mountBookmarkablePage("push/reg", PushRegApi.class);
mountBookmarkablePage("push/send", PushMessageApi.class);
mountBookmarkablePage("device", DeviceprofileExportAsXML.class);
// mountBookmarkablePage("app/download", AppDownloadApi.class);
// mountBookmarkablePage("ds/export", ExportDataSource.class);
// mountBookmarkablePage("control/export", ExportAsXML.class);
MixedParamUrlCodingStrategy ds = new MixedParamUrlCodingStrategy(
"ds", ExportDataSource.class, new String[]{"name"});
mount(ds);
MixedParamUrlCodingStrategy control = new MixedParamUrlCodingStrategy(
"control", ExportAsXML.class, new String[]{"controlName"});
mount(control);
MixedParamUrlCodingStrategy app = new MixedParamUrlCodingStrategy(
"app", AppDownloadApi.class, new String[]{"appId"});
mount(app);
MixedParamUrlCodingStrategy pushReg = new MixedParamUrlCodingStrategy(
enter code here "push/reg", PushRegApi.class, new String[]{"appName",
"groupName","userName","password","deviceToken"});
mount(pushReg);
如果我取消的評論,並刪除MixedParamUrlCodingStrategy
,則一切正常。我如何擁有RESTful URL和我想要的樣式?
你確定如果你刪除MixedParamUrlCodingStrategy的CSS再次正常工作?這隻會改變構建BookmarkablePages的URL的方式。即使在css中使用相對路徑,它們是相對於css而不是當前文檔,所以我不明白爲什麼會發生這種情況。 –
是的。它工作,如果我刪除MixedParamUrlCodingStrategy並安裝包。這是什麼解決方案。 – VNR
請發佈不當行爲的CSS部分,相關HTML部分以及帶和不帶MixedParamUrlCodingStrategy的URL。 –