web2022. 11. 8. 17:53

[web] html 한글 깨짐현상 해결방법

 

webview에서 html 불렀더니, 다 깨져나온다..

 

html만들 때, utf-8로 저장했는데도 안되더라..

 

자 그러면 <body>밑에 

 

<meta charset="UTF-8">

 

넣어주면.. 

 

안깨진다.. html5방식...

Posted by thdeodls85
web2021. 11. 1. 16:20

[Thymeleaf]Property or field 'name' cannot be found on null 해결방법

 

ex) data.category.name

 

이라는 객체를 부를려고 하는데 

 

category가 nulld이면 

 

Property or field 'name' cannot be found on null

 

에러가 나온다..

 

해결할려면...

 

ex) data.category?.name

Posted by thdeodls85
web2021. 2. 15. 11:05

[web]아임포트 본인인증서비스 화면 노출 시키는방법

 

이제 아임포트를 통해 다날 계약은 끝내고 나면 Imp 받을 수 있다..

 

밑에가서 보면 되고

 

중요한 부분만 설명한다.

 

var IMP = window.IMP; // 생략가능

IMP.init('imp00000000'); // 'imp00000000' 대신 부여받은 "가맹점 식별코드"를 사용

 

가맹점 코드를 받았으니 넣어야 되고

 

if ( rsp.success ) {

 

        // 인증성공 

         jQuery.ajax({

        url: "우리 서버에 값이 넘어오는 url를 넣어줘야 한다", // 서비스 웹서버

        method: "POST",

        headers: { "Content-Type": "application/json" },

        data: { imp_uid: rsp.imp_uid }

                }).done(function() {

                    // 이후 Business Logic 처리

                });

    }

 

그러면 데이터가 우리서버로 넘어오게 된다. 

 

[참고] docs.iamport.kr/tech/mobile-authentication

 

[가이드] 휴대폰 본인인증

휴대폰 본인인증 연동하기 휴대폰 본인인증 서비스란 본인 명의로 개통한 휴대폰을 이용하여 최소한의 개인정보를 입력하는 인증 절차를 거쳐 본인 여부와 입력한 정보의 정확성을 확인하여

docs.iamport.kr

 

Posted by thdeodls85
web2020. 11. 30. 15:12

[참조] www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html

 

Posted by thdeodls85
web2020. 9. 18. 15:12

[web]pagenation 처리하는 방법 

 

size -> 10개씩 

page -> 현재 page index

 

 

int endPage = ((int)Math.ceil(page / (double)size)) * size;

int lastPage = ((int)Math.ceil(totalCount  / (double)size));

int beginPage = endPage - (size - 1);

 

// 마지막에 10개 밑일 경우 처리 

if (lastPage < endPage)

{

endPage = lastPage;

}

 

 

 

[참조 ]https://cbts.tistory.com/294

 

[JSP] 페이징(Paging) ① [11월28일]

(결과적으로 띄우고 싶은 화면!) 회원 리스트 밑에 페이지가 추가된 것을 볼 수 있음. 이번에 사용한 project의 모든 파일 일람표. 똑같은 내용에 프로젝트명만 L16Model2Paging으로 하면됩니다! 원래 ��

cbts.tistory.com

 

Posted by thdeodls85
web2020. 9. 16. 17:05

[html]link show new window방법

 

링크를 새로운 윈도우에 띠우고 싶으면...

 

 

<td>

    <a th:href="${url}" target="_blank" th:text="${url}"></a>

    <td>

Posted by thdeodls85
web2020. 9. 14. 17:45

[webspring boot]security server not working aws 해결방법

 

security 썻더니.. 스웨거는 보이는데.. 등록한 html은 나오지 않는다.. 해결하려면

 

server.forward-headers-strategy = native

 

 

Posted by thdeodls85
web2020. 8. 21. 18:08

[html]thymeleaf chart.js 적용방법

 

controller 에서 

 

List<Map<Object,Object>> dataPoints1 = new ArrayList<Map<Object,Object>>();

 

  Map<Object , Object> map1 = new HashMap<Object,Object>();

  map1.put("label", "Chrome"); 

  map1.put("y", 51.08);

  dataPoints1.add(map1);

 

  Map<Object , Object> map2 = new HashMap<Object,Object>();

  map2.put("label", "Internet Explorer");

  map2.put("y", 27.34);

  dataPoints1.add(map2);

 

  Map<Object , Object> map3 = new HashMap<Object,Object>();

  map3.put("label", "Firefox");

  map3.put("y", 10.62);

  dataPoints1.add(map3);

 

// chart

mv.addObject("dataPointsList", dataPoints1);

 

이런식으로 데이터가 넘어온다고 하고...

 

html 상에서

 

<script th:inline="javascript">

window.onload = function() {

// 서버에서 넘어온 값을 스크립트에 넣어주고~

var dataPointsList = [[${dataPointsList}]];

 

var chart = new CanvasJS.Chart("chartContainer", {

theme: "light2", // "light1", "light2", "dark1", "dark2"

exportEnabled: true,

animationEnabled: true,

title: {

text: "Desktop Browser Market Share in 2016"

},

data: [{

type: "pie",

startAngle: 25,

toolTipContent: "<b>{label}</b>: {y}%",

showInLegend: "true",

legendText: "{label}",

indexLabelFontSize: 16,

indexLabel: "{label} - {y}%",

dataPoints: []

}]

});

 

chart.options.data[0].dataPoints = dataPointsList;

chart.render();

 

}

</script>

 

<script th:inline="javascript"> -> 적용 시켜야지만 동작한다.. 기억해야한다..

 

[참조] https://canvasjs.com/forums/topic/spring-mvc-with-thymeleaf/

 

Spring MVC with Thymeleaf | CanvasJS Charts

I have tried to implement one of the Spring MVC examples. Unfortunately, these examples use JSP which is not recommended by Spring and setting up the IDE for JSP development is not straightforward. I was wondering if there is an example using Thymeleaf as

canvasjs.com

 

Posted by thdeodls85