자바

 

 

html meta

		<meta id="_csrf" name="_csrf" content="${_csrf.token}"/>
		<!-- default header name is X-CSRF-TOKEN -->
		<meta id="_csrf_header" name="_csrf_header" content="${_csrf.headerName}"/>
		

 

 

//모달에 메뉴정보 열기
function menuUpdateModal(menuId){		
	var data = {};
	data['menuId']=menuId;	 	 
	 
	$.ajax({
        contentType:'application/json',
        dataType:'json',
		beforeSend:function(xhr){
            /*데이터를 전송하기 전에 헤더에 csrf값을 설정한다*/
            xhr.setRequestHeader("${_csrf.headerName}", "${_csrf.token}");
		},
        data:JSON.stringify(data),
        url:'findByMenu.do',
        type:'POST',
        success:function(response){
                console.log(response);
         },
        error:function(request,status,error){
                alert(error);
        }
     });
}

 

 

about author

PHRASE

Level 60  라이트

하던 지랄도 멍석 펴 놓으면 안 한다 , 평소에는 시키지 않아도 곧잘 하던 일을 정작 남이 하라고 권하면 아니한다.

댓글 ( 4)

댓글 남기기

작성

자바 목록    more