기본 콘텐츠로 건너뛰기

라벨이 JAVA인 게시물 표시

스프링 자바 JAVA 서버에서 URL 찾기

스프링 서버단에서 호출 URL 찾기 서버(spring)에서 호출 URL을 알아야 할때 유용할 듯 @Override      public   void  urlCheck(HttpServletRequest request, HttpServletResponse response) {          //이전 페이지의 정보를 알때 레퍼러를 활용(URL을 직접 치고 들어오는경우는 null)          String  referer  =  ( String ) request.getHeader( "REFEREER" );            //URL를 확인하는 방법         UrlPathHelper urlPathHelper  =   new  UrlPathHelper();          String  originalURL  =  urlPathHelper.getOriginatingRequestUri(request);            //스프링 시큐리티 로그인할떄 저장하는 캐시를 활용         RequestCache requestCache  =   new  HttpSessionRequestCache();         SavedRequest savedRequest  =  requestCache.getRequest(request, response);          String  redirectUrl  =  savedRequest.getRedirectUrl();             } Colored by Color Scripter cs 참고 감사합니다 https://blog.jiniworld.me/53 https://jang8584.tistory.com/86

자바, 스프링, 스프링 부트에서 세션에 데이터 저장하기

자바 스프링에서 세션의 값을 사용해서 저장할 때 컨트롤러에서 이렇게 사용하면 됨 //HttpSession이어야 함(넣기) public   String  example(HttpSession session){       session.setAttribute( "sessionId" ,  12 );        return   "example" ; }       //꺼내기 public   String  exampleReceive(Model model, Eligibility eligibility, HttpSession session) {      if (session.getAttribute( "sessionId" )  = =   null ){          return   "redirect:/bye" ;     } else {          int  sessionId  =  ( int )session.getAttribute( "sessionId" );          //세션 개별 삭제             session.removeAttribute( "sessionId" );           //세션 전체 제거         session.invalidate();          // 세션 유지시간 설정(초단위)           // 60 * 30 = 30분          session.setMaxInactiveInterval( 30 * 60 );           // 세션 시간을 무한대로 설정          session.setMaxInactiveInterval( - 1 );            return   "/exampleReceive" ;     } } Colored by Color Scripter cs 출처  :  https://devuna.tistory.com/53

메이븐으로 라이브러리 인식

 간혹 퍼블릭 jar가 아닌 파일이 있는데 그럴때 쓰면 될듯 <dependency> <groupId> SimpleCryptLib </groupId> <artifactId> SimpleCryptLib </artifactId> <version> 1.1.0 </version> <scope> system </scope> <systemPath> ${basedir}/src/main/webapp/WEB-INF/lib/SimpleCryptLib-1.1.0.jar </systemPath> </dependency> version, scope, systemPath는 꼭 작성해야 한다 groupId, artifactId, version은 암거나 해도 되는거 같음 최근(2021.05.04)스프링 부트    < dependency > < groupId > NiceID </ groupId > < artifactId > NiceID </ artifactId > < version > 1.0 </ version > < scope > system </ scope > < systemPath > ${basedir}/src/main/resources/lib/NiceID.jar </ systemPath > </ dependency > 이걸 추가해주는것도 필요할지도..?? < build > < plugins > < plugin > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-maven-plugi

네이버페이 리뷰 API 연동

네이버 페이 리뷰 API 네이버 측에 문의 하면 sandbox용 인증키를 받습니다. AccessLicense, SecretKey 그리고 받은 파일의 4. WSDL을 열어 주시고 Naver_Pay_API_MallService41_WSDL(sandbox)_20140925파일 압축 풀어주세요 그럼 파일이 BaseType.xsd, CheckoutAPI.wsdl, MallServiceMessage.xsd 세개의 파일이 나옵니다. 네이버페이 리뷰 리스트 가져오는 메소드는 getPurchaseReviewList입니다. BaseType.xsd를 켜신 후 MallID로 검색하면 <xs:complexType name="purchaseReview"> 안쪽의 MallID밑에  <xs:element minOccurs="0" name="PurchaseReviewClassType" type="xs:string"/> 추가해주세요 포토 리뷰를 가져오는 파라미터 값을 보내기 위해서 입니다. <xs:element minOccurs="0" name="Content" type="xs:string"/> 이값도 필요합니다 이미지 경로를 가져오기 위해서 입니다. <xs:complexType name="purchaseReview">     <xs:sequence>       <xs:element minOccurs="0" name="CreateYmdt" type="xs:dateTime"/>       <xs:element minOccurs="0" name="MallID" type="xs:string"/>   <xs:element minOccurs="0" nam

jdk 윈도우10 세팅 환경변수

지긋지긋한 윈도우 세팅 환경변수 -> 시스템 변수 -> 새로 만들기 끝.