공격 스크립트에 CSRF 토큰도 필드로 입력시켜주면 안될까요.? 그러면 세션에 유저의 CSRF 토큰값은 유지되고 파라미터로 넘길 CSRF 토큰도 유저의 토큰이어서 비교했을 때 같지 않을까요? 여기서 전제 조건은 유저의 CSRF토큰을 받을 수 있다는 건데 이건.. 어떻게 알 수 있을지 모르겠지만 안다고 가정하면? 될거 같다는 생각이 들었습니다.
========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? ( 예 /아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? ( 예 /아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/ 아니오 ) [질문 내용] 안녕하세요, " 섹션8 - 옵션처리 " 강의 관련하여 질문합니다. 먼저 AutowiredTest 코드 공유합니다 package hello.core.autowired; import hello.core.member.Member; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.lang.Nullable; import java.util.Optional; public class AutowiredTest { @Test void AutowiredOption() { ApplicationContext ac = new AnnotationConfigApplicationContext(TestBean.class); } static class TestBean { @Autowired(required = false) public void setNoBean(Member noBean1) { System.out.println("noBean1 = " + noBean1); } @Autowired public void setNoBean2(@Nullable Member noBean2) { System.out.println("noBean2 = " + noBean2); } @Autowired public void setNoBean3(Optional<Member> noBean3) { System.out.println("noBean3 + " + noBean3); } } } ApplicationContext ac = new AnnotationConfigApplicationContext(TestBean.class); 를 통해 TestBean을 등록하고 위와같이 Autowired관련 테스트를 위한 코드를 강의 내용과 같이 작성하였습니다. 하지만 @Autowired 어노테이션에 붉은줄이 생기며 "Autowired members must be defined in valid Spring bean"라는 에러가 발생합니다. 동일한 파일에서 아래와 같은 TestCofig 클래스 코드를 추가해주면 에러가 사라집니다. 제가 작성한 코드에 어떠한 문제가 있는지 아직 파악하지 못하여 의문을 풀지 못하였습니다. @Configuration static class TestConfig { @Bean public TestBean testBean() { return new TestBean(); } }
여기에 글을 남겨서 죄송합니다 ㅠㅠ 수강전 문의에는 이어서 답변하기 기능이 없어서 여기로 하는 점 양해 부탁드립니다. 25년 2월 16일에 스프링 배치 할인이 시작 되게 해주신점 감사드립니다. 하지만 조금더 일찍 제가 구매할 수 있을까요? 다음주에 면접이 잡혀서 ㅠㅠ 한번 공부하고 가면 훨씬 도움이 될거 같습니다.
상세페이지 href속성을 찾아 기존페이지 url?상세페이지 url을 적용하여 실습을 성공해 오다가 난관에 부딪혔습니다. html속성값을 보니 아래와 같이 되어 있고 url에 붙이거나 해도 페이지가 로드 되지 않아 어려움을 겪고 있습니다. <a href="Javascript:view_content('869');">처리 일정 문의 드립니다.</a> 위와같은 href가 나타날때는 어떻게 상세페이지로 이동해야 하는지 궁금하고 이럴때 혹시 우회할 수 있는 대안이 있다면 알고 싶어요
for ( int number : fibonacci){ cout << number << " " ; } cout << endl ; 여기서 number는 그냔 for문의 i 같은거고 foreach문 {} 안에서만 존재하는 변수죠? 그리구 배열에만 사용할 수 있는 반복문인게 맞나요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. UserEffect 빈 배열 사용하면 처음 한번만 실행된다고 하는데 그러면 조건문으로 posts 체크해서 사용해도 되나요? 왠지 유저이펙트보다 이프문이 더 가벼울것 같아서 질문드립니다
안녕하세요 교수님, 내용중에 궁금한 점이 있어 질문 남겨 봅니다. NonFlip과 삼각근 수업 18:14 ~ 18:21 초에 " 지금은 포인트 헬퍼로 설명하지만 리깅 할 때는 본을 만들어 주겠죠 " 라고 하셨는데, 스키닝본 (=익스포트본) 을 따로 있는 리깅을 할 꺼라면, 지금 하신 것 처럼 헬퍼들로 구성해도 괜찮은 것 아닌가요? 리깅할때면 본으로 했을 거라는 것에 어떤 이유가 있을지 좀 더 궁금합니다.
junt4로 gradle에서 설정하려고 하면 오류가 발생해서 juit5로 하는 중입니다. MemberRepositoryTest를 junit5버전으로 고쳐서 아래의 코드로 실행했는데 오류가 나고 있습니다 import jpabook.jpashop.Member; import jpabook.jpashop.MemberRepository; //import jpabook.jpashop.domain.Member; //import jpabook.jpashop.repository.MemberRepository; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.transaction.annotation.Transactional; @ExtendWith(SpringExtension.class) // JUnit 5 방식 @SpringBootTest public class MemberRepositoryTest { @Autowired MemberRepository memberRepository; @Test @Transactional @Rollback(false) public void testMember() { Member member = new Member(); member.setUsername("memberA"); Long savedId = memberRepository.save (member); Member findMember = memberRepository.find(savedId); Assertions.assertThat(findMember.getId()).isEqualTo(member.getId()); Assertions.assertThat(findMember.getUsername()).isEqualTo(member.getUsername()); Assertions.assertThat(findMember).isEqualTo(member); // JPA 엔티티 동일성 보장 } } 밑에는 오류입니다. Unable to find a @SpringBootConfiguration by searching packages upwards from the test. You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test supported mechanisms to explicitly declare the configuration classes to load. Classes annotated with @TestConfiguration are not considered. java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration by searching packages upwards from the test. You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test supported mechanisms to explicitly declare the configuration classes to load. Classes annotated with @TestConfiguration are not considered. at org.springframework.util.Assert.state(Assert.java:79) 1. @SpringBootTest(classes=...) 로 명시적으로 설정 클래스 지정 2. @SpringBootApplication 이 있는 클래스의 위치 확인 3. @ContextConfiguration 을 사용해서 명시적으로 설정 클래스 지정 이세가지를 시도해도 안되고 있습니다. 아니면 juni4룰 사용해야만 할까요? build.gradle에 JUnit4 추가 testImplementation("org.junit.vintage:junit-vintage-engine") { exclude group: "org.hamcrest", module: "hamcrest-core" } 를 하면 Build file 'C:\Users\Peter\Desktop\study\jpashop\build.gradle' line: 45 A problem occurred evaluating root project 'jpashop'. > Could not find method testImplementation() for arguments [org.junit.vintage:junit-vintage-engine, build_55eer8btj8rd1l6xp0yqapa0y$_run_closure6@6e20627f] on root project 'jpashop' of type org.gradle.api.Project. 라고 나옵니다.