게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
ajax로 댓글 만들고있는데 질문이 있습니다.
게시물ID : programmer_6133짧은주소 복사하기
작성자 : 조커즈
추천 : 0
조회수 : 442회
댓글수 : 3개
등록시간 : 2014/10/22 22:28:49
옵션
  • 베스트금지
  • 본인삭제금지
환경은 struts2 , ibatis , tomcat 입니다.
댓글출력 부분을 ajxa로 구현하고있는데 action의 commentList에 들어가서 List를 출력해봤는데 그때까지는 잘 나왔는데
그뒤 바로 error 페이지로 갑니다. 혹시나 아시는분이 있으실까 해서 질문드립니다..
jsp 부분 

function commentList() {
var boardNum = "<s:property value='boardVo.boardNum'/>";
 
$.ajax({
         url: '/mamma/sanghyun/commentList.action',
         type:'post',
         data:{boardNum:boardNum},
         dataType: 'json',
         error: output,
         success: output
         
      });
function output(msg) {
$('#commentDiv').html('<input type ="text">');
alert(msg);
var str = '';
$.each(msg.commentList, function(key, item){
str += '<tr><td>'+item.nickname;
str += '</td></tr>';
});
str +='</table>';
alert(str);
$('#commentDiv').html(str);

action 부분 

public String commentList(){
commentList = new sanghyunDao().commentList(boardNum);
System.out.println(commentList);
return SUCCESS;
}

struts 부분

-<action name="commentList" method="commentList" class="mamma.action.sanghyunAction">

<result type="json"/>

</action>



전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호