只能刪除pid爲整數的商品,32位的pid商品不能刪除? 緣由onclick="agree('${s.pid}')" 括號中須要加 ' 'html
刪除多餘的工做空間? 使用preferences general startup and shutdown java
數據庫的更新語句"update product set pname=? market_price=? shop_price=? pimage=? pdesc=? where pid=?"很差用? 每一項要用","分隔老是寫錯web
jsp頁面不顯示轉發的對象? 緣由 <c:forEach var="p" items="${productList }"> items寫的內容""中要寫EL表達式,不要直接寫變量名數據庫
類找不到異常? 緣由Apache tomcat配置中路徑錯誤,需從新配置apache
request請求添加到數據庫所有null出錯? 緣由多是你的表單沒有name屬性tomcat
javaWeb 異常的處理方法?底層異常直接拋 如ServletException, IOException 其餘異常選中幾行後快捷鍵alt+shift+z用try catch包圍服務器
頁面沒法顯示? 是服務器沒有開jsp
filter沒有生效? 注意新添加的filter直接運行是不行的,改變了web.xml文件須要從新啓動服務器才行.post
一、重定向 response.sendRedirect("url");
二、轉發 request.getRequestDispatcher("url").forward(request, response);
三、下載文件 response.setHeader("Content-Disposition", "attachment;filename="+filename);
四、解決post亂碼:
request.setCharacterEncoding(「utf-8」)
解決get亂碼:
不經常使用 new String(「」.getBytes(「iso8859-1」),」utf-8」);
經常使用 apache Tomcat 的server.xml中有8080的地方,增長一個URIEncoding="utf-8"url
五、response.setContentType("text/html;charset=utf-8");