從action中往jsp中傳值的方法,在action中用request.setAttribute()方法,jsp頁面中用request.getAttribute()的方法。
從jsp中往action中傳值的方法,方法1:通過form中的input值傳入;方法2:通過跳轉url地址後加入的參數傳入。如:jsp頁面中“url?action=abc&userId=”+userId,action頁面中用request.getParameter("userId");
從action中往jsp中傳值的方法,在action中用request.setAttribute()方法,jsp頁面中用request.getAttribute()的方法。
從jsp中往action中傳值的方法,方法1:通過form中的input值傳入;方法2:通過跳轉url地址後加入的參數傳入。如:jsp頁面中“url?action=abc&userId=”+userId,action頁面中用request.getParameter("userId");