已采納回答 / 無動于衷
得到goods(Map類型的引用)里 Key是item的Value值。像是這樣:這是goods????????????Key????????????? | ?? ? Value? ? a ? ? ? ? ? ? ? ? ? | ? ? ? ? 1? ? b ? ? ? ? ? ? ? ? ? | ? ? ? ? 2?item ? ? ? ? ? ? ? ? | ? ? ? ? 3goods.get(item)=3
2015-09-23
已采納回答 / _瀟瀟暮雨
在Servlet中無法使用jsp內置對象,但是可以通過request.getSession()取得session啊。在jsp頁面中可以使用EL表達式或者session.getAttribute()取得用戶名。
2015-09-21
if(shoppingList.containsKey(i)){
this.shoppingList.replace(i, this.shoppingList.get(i)+amount);
return true;
}
this.shoppingList.replace(i, this.shoppingList.get(i)+amount);
return true;
}
2015-09-20
在reg.jsp中跳轉方式是post,直接跳轉到RegServlet.java的doPost方法就好啦, 可為什么還要在RegServlet.java的doGet方法中寫doPost方法呢??
2015-09-19