eclipse 創(chuàng)建的 servelt 注意@WebServlet這句注解,創(chuàng)建時(shí)為@WebServlet("/HelloServlet"),把包名加上就可以了@WebServlet("/servlet/HelloServlet")
2018-08-02
1.11小節(jié) 在jsp頁面里new simpledateformat對象 格式化日期時(shí)不能直接用對象,要用對象里面的format方法,不然出不來。這里沒講到,讓我浪費(fèi)了好多時(shí)間。很不滿意。
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
代碼會(huì)運(yùn)行到 var num = document.ge前面就沒反應(yīng)了 ,哪里錯(cuò)了呢?
{
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
代碼會(huì)運(yùn)行到 var num = document.ge前面就沒反應(yīng)了 ,哪里錯(cuò)了呢?
關(guān)于不同的傳參方式到servlet
jsp頁面請求servlet用jquery傳參數(shù)和用form表單傳參數(shù)都可以訪問到servlet,并且servlet也接收到參數(shù)的值,但是只有form表單傳參數(shù)可以在servlet里通過request.getRequestDispatcher到相應(yīng)的jsp頁面,點(diǎn)解啊。。。。
jsp頁面請求servlet用jquery傳參數(shù)和用form表單傳參數(shù)都可以訪問到servlet,并且servlet也接收到參數(shù)的值,但是只有form表單傳參數(shù)可以在servlet里通過request.getRequestDispatcher到相應(yīng)的jsp頁面,點(diǎn)解啊。。。。
2018-06-03
。
cart = (Cart) request.getSession().getAttribute("cart")不會(huì)新開辟內(nèi)存空間,而是讓cart引用變量指向Session中的cart對象。所以在Servlet中不用request.getSession().setAttribute("cart", cart);也能添加商品進(jìn)購物車
。
cart = (Cart) request.getSession().getAttribute("cart")不會(huì)新開辟內(nèi)存空間,而是讓cart引用變量指向Session中的cart對象。所以在Servlet中不用request.getSession().setAttribute("cart", cart);也能添加商品進(jìn)購物車
。
2018-05-16
模型1:jsp+javabean,最早出現(xiàn)的開發(fā)模式
模型二:servlet+javabean+jsp,更為體現(xiàn)mvc的設(shè)計(jì)思想
模型二:servlet+javabean+jsp,更為體現(xiàn)mvc的設(shè)計(jì)思想
2018-04-27