목록분류 전체보기 (163)
KSI일기장
파일 업로드 하려고 한것도 아닌데 저런 에러가 떠서 당황했지만 당황하지 않은척 침착하게 찾아본 결과 파일업로드에 관한 라이브러리 추가를 하지 않았었다 pom.xml에 라이브러리 추가해줘 해결 했습니다 pom.xml commons-fileupload commons-fileupload 1.4
오류내용: java.lang.IllegalStateException: No thread bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bGVmEi/btse9ewCYCx/y3IMu720ySgw1QZj0FuU3K/img.png)
Spring AOP : Spring AOP 란, 관점 지향 프로그래밍(Aspect Oriented Programming)의 약자로 일반적으로 사용하는 클래스(Service, Dao 등) 에서 중복되는 공통 코드 부분(commit, rollback, log 처리)을 별도의 영역으로 분리해 내고, 코드가 실행 되기 전이나 이 후의 시점에 해당 코드를 붙여 넣음으로써 소스 코드의 중복을 줄이고, 필요할 때마다 가져다 쓸 수 있게 객체화하는 기술을 말한다.
// 개행문자 처리 public static String newLineHandling(String content) { return content.replaceAll("(\r\n|\r|\n|\n\r)", " "); } // 개행문자 해제 public static String newLineClear(String content) { return content.replaceAll(" ", "\n"); } --> DB에 저장시 개행문자(줄바꿈)은 "\n"으로 인식하기 때문에 jsp 에서의 enter 즉 개행문자가 태그로 되있는 상태로 인식하게 됩니다. 그래서 표시가 안되는 상황이 나타납니다. ->해결을 위해서는 \n으로 변경이 필요 합니다
XSSHandling :크로스 사이트 스크립팅(XSS) 공격을 방지하기 위한 메소드 // 크로스 사이트 스트립트 공격을 방지 하기 위한 메소드 public static String XSSHandling(String content) { if(content != null) { content = content.replaceAll("&", "&"); content = content.replaceAll("", ">"); content = content.replaceAll("\"", """); } return content; } // 크로스 사이트 스트립트 해제 public static String XSSClear(String content) { if(content != null) { content = conten..
*댓글수정* -ReplyController //댓글 수정 /*url : contextPath + "/reply/update", data : {"replyNo" : replyNo, "replyContent" : replyContent}, type : "POST" */ @PostMapping("/update") public int replyUpdate(@ModelAttribute Reply reply ) { // -> vo객체를 가져올때는 @ModelAttribute reply.getReplyNo(); reply.getReplyContent(); int result = replyservice.replyUpdate(reply); return result; } -ReplyService /**댓글수정 * @par..
*방법1* (Map에 값 담아서 전달하기) -ReplyController //댓글 등록 /* url : contextPath + "/reply/insert", data : {"memberNo" : loginMemberNo, "boardNo" : boardNo, "parentReplyNo" : parentReplyNo, "replyContent" : replyContent}, type : "POST", myPage 비밀번호변경 참고 */ //@RequestParam Map map 선언시 ajax의 data 값 map에 담겨진다 @PostMapping("/insert") public int replyInsert(@RequestParam Map map, @RequestParam(value="parentRepl..
org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "delete" Caused by: java.lang.NumberFormatException: For input string: "delete" For input string: "delete" -> 으로 봤을 때 delete 가 버튼이 잘못 되있는것으로 예상되어 확인해보니 jsp 에서 delete button ..