eclipse 創建的 servelt 注意@WebServlet這句注解,創建時為@WebServlet("/HelloServlet"),把包名加上就可以了@WebServlet("/servlet/HelloServlet")
2018-08-02
1.11小節 在jsp頁面里new simpledateformat對象 格式化日期時不能直接用對象,要用對象里面的format方法,不然出不來。這里沒講到,讓我浪費了好多時間。很不滿意。
2018-07-09
function selflog_show(id)
{
var num = document.getElementById("number").value;
J.dialog.get({id: 'haoyue_creat',title: '購物成功',width: 600,height:400, link: '<%=path%>/servlet/CartServlet?id='+id+'&num='+num+'&action=add', cover:t
代碼會運行到 var num = document.ge前面就沒反應了 ,哪里錯了呢?
{
var num = document.getElementById("number").value;
J.dialog.get({id: 'haoyue_creat',title: '購物成功',width: 600,height:400, link: '<%=path%>/servlet/CartServlet?id='+id+'&num='+num+'&action=add', cover:t
代碼會運行到 var num = document.ge前面就沒反應了 ,哪里錯了呢?
關于不同的傳參方式到servlet
jsp頁面請求servlet用jquery傳參數和用form表單傳參數都可以訪問到servlet,并且servlet也接收到參數的值,但是只有form表單傳參數可以在servlet里通過request.getRequestDispatcher到相應的jsp頁面,點解啊。。。。
jsp頁面請求servlet用jquery傳參數和用form表單傳參數都可以訪問到servlet,并且servlet也接收到參數的值,但是只有form表單傳參數可以在servlet里通過request.getRequestDispatcher到相應的jsp頁面,點解啊。。。。
2018-06-03
。
cart = (Cart) request.getSession().getAttribute("cart")不會新開辟內存空間,而是讓cart引用變量指向Session中的cart對象。所以在Servlet中不用request.getSession().setAttribute("cart", cart);也能添加商品進購物車
。
cart = (Cart) request.getSession().getAttribute("cart")不會新開辟內存空間,而是讓cart引用變量指向Session中的cart對象。所以在Servlet中不用request.getSession().setAttribute("cart", cart);也能添加商品進購物車
。
2018-05-16