Struts 에서 action 으로 forward 할 경우 parameter를 넘겨주는 방법
게시글에 댓글을 쓸 경우 댓글을 DB에 저장하는 Action을 호출한 후 다시 그 게시글로 돌아와야하는데
forward를 사용하면 parameter를 넘겨줄 수가 없었다.
찾다찾다 방법을 알아냈는데..
출처 : http://greenwebber.tistory.com/56
더 많은 방법이 있지만 현재 사용하고 있는 Struts 버전이 1.1 이라서 이 방법이 최선이다.
ActionRedirect 는 1.2x 버전부터 되는 것 같았다.
forward를 사용하면 parameter를 넘겨줄 수가 없었다.
찾다찾다 방법을 알아냈는데..
출처 : http://greenwebber.tistory.com/56
ActionForward forward = mapping.findForward("success");
ActionForward redirect = new ActionForward(forward.getName(), forward.getPath() + "?paramName=" + paramValue, true );
return redirect ;
더 많은 방법이 있지만 현재 사용하고 있는 Struts 버전이 1.1 이라서 이 방법이 최선이다.
ActionRedirect 는 1.2x 버전부터 되는 것 같았다.
반응형
공지사항
최근에 올라온 글
- Total
- 734,422
- Today
- 2
- Yesterday
- 24
TAG
- 티스토리
- Eclipse
- 레시피
- 찬양
- Linux
- 검색
- 망치
- electron
- Flutter
- electron 시작하기
- Daum
- 리뷰
- 넷플릭스
- 영화
- IE
- chrome
- 글꼴
- Ubuntu8.04
- 요리
- react
- 다음
- Firefox
- ubuntu
- Firefox3
- Tistory
- github actions
- virtualbox
- 보안
- Mac