2019/7/8
1.爲什麼訪問不了正確的網址,本應該是http://localhost:6666/StudentManagerSSM/system/index,然而實際上卻是http://localhost:6666/system/index。
因爲jsp文件中的
<% response.sendRedirect("/system/index"); %>
這行中system前面不應該再有/ 。
2.爲什麼總是404,而且網站地址是正確的爲http://localhost:6666/StudentManagerSSM/system/index
但是就是“not available”。
因爲我的views文件創建在了錯的目錄(webcontent)下,其創建的目錄一定要與springmvc中的配置(即在web-inf下)要一樣:
<!-- 配置視圖解析器。拿到數據後怎麼渲染到界面上展示給用戶 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 頁面模板的前綴是什麼 -->
<property name="prefix" value="/WEB-INF/views/"></property>
<!-- 頁面模板的後綴是什麼 -->
<property name="suffix" value=".jsp"></property>
</bean>
2019/7/11
3.爲什麼點擊用戶列表卻顯示404,usercontroller裏面的方法也進不去
//用戶管理列表頁
@RequestMapping(value="/list",method=RequestMethod.GET)
public ModelAndView list(ModelAndView model){
model.setViewName("user/user_list");
return model;
}
原因:
是我太蠢了,JSP的文件名給我起錯了。。。
controller中的是小寫的user_list,難怪找不到文件。
還有就是getlist方法中的 queryMap.put("username", "%"+username+"%"); 寫錯了。
4.同樣的,獲取列表時候也出現了404的錯誤:
這次原因是:userController中的value值寫成了get_List,而對應的jsp頁面中datagrid中的url寫成了get_list,可見這兩者要對應好了。
2019/7/13
5.出現以下報錯信息:
No qualifying bean of type 'com.ischoolbar.programmer.service.GradeService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
原因是GradeServiceImpl.java中
public class GradeServiceImpl implements GradeService {
...
}
寫成了
public class GradeServiceImpl implements GradeDao {
...
}
6.出現點擊年級列表界面點擊修改按鈕無法跳出窗口的錯誤。
原因:在彈出窗口的設置中沒有添加easyui的class
原來是這樣的:
<td><input id="edit_remark" style="width: 256px; height: 180px;" name="remark" data-options="multiline:true"></td>
修改後爲:
<td><input id="edit_remark" class="easyui-textbox" style="width: 256px; height: 180px;" name="remark" data-options="multiline:true"></td>
2019/7/17
7.出現NetWork、preview、response中數據完全正確,但提交圖片後無法出現彈窗以及更換預覽圖片的情況。前端調試是顯示如下:
後端debug後發現數據也完全正確,經與源代碼仔細追溯後發現問題出在很基礎的語法錯誤上
function uploaded(e){
var data = $(window.frames["photo_target"].document).find("body pre").text();
if(data = '')return;
data = JSON.parse(data);
//console.log(data);
if(data.type == "success"){
$.messager.alert("消息提醒","圖片上傳成功!","info");
$("#photo-preview").attr("src",data.src);
$("#add_photo").val(data.src);
}else{
$.messager.alert("消息提醒",data.msg,"warning");
}
}
第三行應該是 “==”而不是“=”,又是一個讓人無語的錯誤。
if(data == '')return;