[JSP] .getParameter(), .getAttribute()


[JSP] .getParameter(), .getAttribute()

@ .getParameter String형으로 반환 request에서 값을 꺼내올 때 쓰는 메소드 (HttpServletRequest에서 정보를꺼내옵니다) 값을 꺼내올때 쓰는 메소드이기때문에 일단 (요청).setParameter()는 없습니다 String no = request.getParameter("no") //String형 때문에 no을 따로 //int형으로 따로형변환해서사용가능 @.getAttribute Object타입으로 반환 속성(Attribute)를 꺼내올떄 사용(객체,클래스를 받아올때사용(scope영역)) 형변환을 하고 사용 String no = (String)request.getParameter("no") +scope영역 = 변수가 존재 할 수있는 영역 또는 함수의 유효 범위


원문링크 : [JSP] .getParameter(), .getAttribute()