的WebContent - 資源 - CSS - style.css的 WEB-INF - index.html的的Restlet CSS和JavaScript文件
public synchronized Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach("/", IndexResource.class);
return router;
}
的IndexResource執行一個HTML Respresentation(的index.html)
在我的index.html中,我指定了一個css文件。問題是無法找到它。
<link href="/resources/css/style.css" rel="stylesheet" type="text/css">
我認爲/resources/css/style.css
是通過restlet而不是實際的文件路徑。如何停止作爲servlet(restlet)執行的資源文件夾?
可能的重複:http://stackoverflow.com/questions/9651019/cant-get-resource-files-in-my-template-files-using-restlet-and-freemarker –
嘗試使您的鏈接相對「資源/ css/style.css「而不是絕對的 – Sean