1
我想給背景。圖片加載時正確的網址是(在登錄頁)彈出的mvc背景圖片無法正常工作當url更改
/jobsspectrum/login
通過使用個人資料頁
<body background="resources/images/black.jpg">
但是當URL改變圖像不會加載。例如。
/jobsspectrum/user/profile
because there is /user in the url before the page where i am using image in profile page.
錯誤是
message /jobsspectrum/user/resources/images/black.jpg
description The requested resource is not available.
我的形象是在資源/圖像
它不選擇資源時的網址並非/ jobsspectrum/
我的資源處理類是:
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("resources/");
super.addResourceHandlers(registry);
}
我簡單的話只在頭版中選擇圖片,當用戶從/ jobsspectrum /到/ jobsspectrum/user/**登錄我的網址時,資源圖片部分未正確加載。
謝謝主席先生。這有助於這樣一個簡單的解決方案。你在其他問題上也幫了我很多。 TY ..兩個解決方案都可以工 – Kharoud 2015-04-05 09:00:12