【問題已解決】黑馬旅遊網Uncaught TypeError: Cannot read property ‘name‘ of null問題

在黑馬旅遊網姓名提示部分,出現前臺報錯Uncaught TypeError: Cannot read property ‘name’ of null 問題原因:由於LoginServlet在登錄成功時沒有把User存入Session中,導致從Session中取時會出現從NULL中取的情況。 解決方案:在LoginServlet中登陸成功時加入request.getSession().setAttr
相關文章
相關標籤/搜索