最后
Q4:報java.lang.NumberFormatException: null,查看根因在servlet的addToCart方法內
A4:cart.addGoodsInCart(item,Integer.parseInt(number))的Integer.parseInt方法不允許轉換為null的字符串,由于在details.jsp中定義的參數為num,而在servlet方法中獲取number,所以導致獲取不到http請求數據,增加至購物車報500
最后吐槽下,慕課的評論功能做的真不咋地。。。
Q4:報java.lang.NumberFormatException: null,查看根因在servlet的addToCart方法內
A4:cart.addGoodsInCart(item,Integer.parseInt(number))的Integer.parseInt方法不允許轉換為null的字符串,由于在details.jsp中定義的參數為num,而在servlet方法中獲取number,所以導致獲取不到http請求數據,增加至購物車報500
最后吐槽下,慕課的評論功能做的真不咋地。。。
2018-12-27
Q3:報錯An invalid character [44] was present in the Cookie value
A3:ascii編碼不支持",",將對應處改為"#"等符號即可,在details.jsp和servlet內
A3:ascii編碼不支持",",將對應處改為"#"等符號即可,在details.jsp和servlet內
2018-12-27
Q2:tomcat加載jdbc驅動包失敗,但測試util包下的類加載正常,報錯No suitable driver found for jdbc:mysql://localhost:3306/shopping
A2:未在jre/lib/ext目錄下找到jdbc的驅動包
A2:未在jre/lib/ext目錄下找到jdbc的驅動包
2018-12-27
在跟著源碼敲時遇到的坑:
Q1:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
A1:數據庫連接時區問題,在命令行中連接數據庫后使用set global time_zone = '+8:00';
Q1:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
A1:數據庫連接時區問題,在命令行中連接數據庫后使用set global time_zone = '+8:00';
2018-12-27
ecliplse自動注冊的servlet里的標簽<url-pattern>沒有/servlet,暈
2018-11-14