spring-jdbc 버전 오류

JAVA/Spring 2017. 8. 14. 00:17 Posted by Dayis

1. 에러 메시지

Root Cause

java.lang.NoSuchMethodError: org.springframework.core.convert.support.DefaultConversionService.getSharedInstance()Lorg/springframework/core/convert/ConversionService;
	org.springframework.jdbc.core.BeanPropertyRowMapper.<init>(BeanPropertyRowMapper.java:91)
	com.javalec.mybatis.dao.ContentDao.listDao(ContentDao.java:31)
	com.javalec.mybatis.HomeController.list(HomeController.java:55)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


2. 에러 라인 코드 : (ContentDao.java:31)

ArrayList<ContentDto> dtos = (ArrayList<ContentDto>) template.query(query, new BeanPropertyRowMapper<ContentDto>(ContentDto.class));



3. 아래와 같이 jdbc 버전을 변경하여 해결

[변경 전]

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-jdbc</artifactId>

<version>4.3.5.RELEASE</version>

</dependency>


[변경 후]

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-jdbc</artifactId>

<version>4.1.4.RELEASE</version>

</dependency>

<jsp:useBean>에서 에러 발생 시..

JAVA/JSP 2017. 6. 8. 09:38 Posted by Dayis

<jsp:useBean>에서 아래와 같은 에러가 발생 시..


javax.servlet.ServletException: java.lang.NoSuchMethodError: member.MemberInfo: method <init>()V not found


The value for the useBean class attribute is invalid.


해결 : 해당 클래스 파일(member.MemberInfo)에 기본생성자를 추가할 것~!!!

public MemberInfo() {


}

함수 호출 시 ajax로 리턴값 받기

JAVASCRIPT 2016. 1. 29. 11:43 Posted by Dayis

1. 지역변수를 통해 리턴한다. (success 내에서 리턴하면 안됨)

2. async: false 속성 사용


<script type="text/javascript">

<!--

function AAA(){

var r = "";


$.ajax({

url:...

async: false,

success: function(result){

r = false;

}

});


return r;

}

//-->

</script>


jQuery-rwdImageMaps-master.zip


출처 : https://github.com/stowball/jQuery-rwdImageMaps


<!-- 사용방법 -->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<script src="jquery.rwdImageMaps.min.js"></script>

<script type="text/javascript">

<!--

$(document).ready(function(e) {

    $('img[usemap]').rwdImageMaps();

});

//-->

</script>

'JAVASCRIPT' 카테고리의 다른 글

함수 호출 시 ajax로 리턴값 받기  (0) 2016.01.29
iframe 자동 높이 조절  (0) 2015.10.19
마우스 클릭 위치 좌표값  (0) 2015.08.21
Datepicker 설정  (0) 2015.07.23
즐겨찾기 추가 스크립트  (0) 2015.07.18

쿠키(Cookies) 중복 체크 및 처리

ASP 2015. 11. 7. 16:30 Posted by Dayis

'-------------------------------------------------
' 쿠키 중복 체크
'-------------------------------------------------
Function CookieDuplicateCheck(tableName, idx)
    dim dupliChk
    dim c_read_idx
    dim i
    dupliChk = false
    
    c_read_idx = Request.Cookies("C_TABLE_NAME")("READ")
    
    Response.Cookies("C_TABLE_NAME") = tableName
    Response.Cookies("C_TABLE_NAME").Path = "/"
    Response.Cookies("C_TABLE_NAME").Expires = date+1

    arrRead = split(c_read_idx,",")
    for i = 1 to UBound(arrRead)
        if CInt(idx) = CInt(Trim(arrRead(i))) then
            dupliChk = true
        end if
    next
    if dupliChk = true then
        Response.Cookies("C_TABLE_NAME")("READ") = c_read_idx
    else
        Response.Cookies("C_TABLE_NAME")("READ") = c_read_idx & "," & idx
    end if
    CookieDuplicateCheck = dupliChk
End Function



If CookieDuplicateCheck("board", idx)=False Then 

'쿠키정보가 없을 때 처리

else

  '쿠키정보가 있을 때 처리

End If 

'ASP' 카테고리의 다른 글

ASP 달력 Calendar  (0) 2015.09.23
ASP 쿠키 로그인/로그아웃  (0) 2015.07.21
년월의 마지막 날짜(일) 구하기  (0) 2015.07.18
ASP 이미지 가로, 세로 크기 구하기  (0) 2015.01.19
페이지 초기번호  (0) 2015.01.04

<style type="text/css">

#toTop

{

z-index:1030;

width: 50px;

height: 45px;

border: 2px solid #f7f7f7;

background: #f7f7f7;

text-align: center;

position: fixed;

bottom: 50px;

right: 10px;

cursor: pointer;

display: none;

color: #333;

opacity: 0.6;

filter: alpha(opacity=60);

-webkit-border-radius: 10px;

-moz-border-radius: 10px;

-o-border-radius: 10px;

border-radius: 10px;

-webkit-transition: all .25s linear;

-moz-transition: all .25s linear;

-o-transition: all .25s linear;

transition: all .25s linear;

}

#toTop:hover

{

background: #b3b3b3;

border: 2px solid #b3b3b3;

*{outline:none;}

</style>


<script language="javascript">

$(document).ready(function(){

$('body').append('<div id="toTop"><img src="arrow-up.png"></div>');

$("#toTop").bind("click", function () {$("body,html").animate({ scrollTop: 0 }, 400);});

$(window).scroll(function () {

if ($(this).scrollTop() != 0) {

$('#toTop').fadeIn();

} else {

$('#toTop').fadeOut();

}

});

});

</script>



※ 화살표 이미지

iframe 자동 높이 조절

JAVASCRIPT 2015. 10. 19. 21:15 Posted by Dayis

여태까지 iframe 높이를 자동으로 적용되는 소스를 많이 봐왔지만 거의 실패했습니다.

특히 제로보드 같은 게시판을 불러오면 아무래도 jQuery 나 Javascript 에서 충돌이 일어나 적용이 잘 안됐는데 이번에 완전 제대로 된것을 찾았습니다.

 

<body>에 <iframe> 넣을 곳에 아래와 같은 소스를 넣어주면 됩니다.

참고로 주의하실 점은 iframe 태그 밑에 스크립트 소스를 넣어주셔야 작동됩니다.

 

<iframe id="board" width="100%" scrolling="no" src="페이지주소" frameborder="0"></iframe>

<script>
 function resize_frame(id) {

 var frm = document.getElementById("board");

 function resize() {

 var ms_ie = false;

  var ua = window.navigator.userAgent;

  var old_ie = ua.indexOf('MSIE ');

  var new_ie = ua.indexOf('Trident/');

 

  if ((old_ie > -1) || (new_ie > -1)) {

   ms_ie = true;

  }

 

  if ( ms_ie ) {

   //IE specific code goes here

  var iframeHeight=frm.contentWindow.document.body.scrollHeight;

  frm.height=iframeHeight+20;

  }else{

  frm.style.height = "auto"; // set default height for Opera

  contentHeight = frm.contentWindow.document.documentElement.scrollHeight;

  frm.style.height = contentHeight + 23 + "px"; // 23px for IE7

  }

 }

 if (frm.addEventListener) {

 frm.addEventListener('load', resize, false);

 } else {

 frm.attachEvent('onload', resize);

 }

}

resize_frame('board'); 
</script>

 

 

일단 위의 소스를 붙여넣으셔서 테스트를 해보세요.

여기까지 진행하셔서 잘 되셨다면 문제가 없습니다.

아래 소스는 건드릴 필요가 없습니다.

 

 

 

 

만약!!!!!!!!!!!!!!

제로보드4의 DQ갤러리를 사용하다 보면 사진을 업로드 하는 플래시 때문에 아래로 더 이상 안내려 간다면 아래의 소스를 <head>에 추가해서 삽입하세요.

 

<script type="text/javascript">

window.onload = function() {
    var lastHeight = 0;
    var curHeight = 0;
    var targetFrame = document.getElementById('board'); // iframe id 입력
 
    targetFrame.onload = function(){
        curHeight = targetFrame.contentWindow.document.body.scrollHeight + 'px';
        targetFrame.style.height = curHeight;
    }
 

    setInterval(function(){
            curHeight = targetFrame.contentWindow.document.body.scrollHeight + 'px';
            if ( curHeight != lastHeight ) {
              targetFrame.style.height = curHeight;
              lastHeight = curHeight;
            }
    },500);
            

</script>

 

 

 

 

출처 : http://sir.co.kr/qa/?wr_id=50479

출처 : http://blog.naver.com/justerkr/220106272136

ASP 달력 Calendar

ASP 2015. 9. 23. 14:48 Posted by Dayis

asp_calendar.zip


1. clsCalendar.asp
<%
Class Calendar
Private cShowDate
Private cValue
Private cBorder
Private cMonth
Private cYear
Private arrMonths(12)
Private cFonts
Private cFontSize
Private cShowNav
Private cShowForm

Private Sub  Class_Initialize()
cBorder = True
arrMonths(1) = "1"
arrMonths(2) = "2"
arrMonths(3) = "3"
arrMonths(4) = "4"
arrMonths(5) = "5"
arrMonths(6) = "6"
arrMonths(7) = "7"
arrMonths(8) = "8"
arrMonths(9) = "9"
arrMonths(10) = "10"
arrMonths(11) = "11"
arrMonths(12) = "12"

cValue = Now
cMonth = Month(Now)
cYear = Year(Now)
cFonts = "Verdana"
cFontSize = 2
cShowNav = False
cShowForm = False
cShowDate = False
End Sub

Private Sub Class_Terminate()

End Sub


Public Property Let Border(byRef uBorder)
cBorder = uBorder
End Property

Public Property Get Border()
Border = cBorder
End Property


Public Property Get Value()
Value = cValue
End Property

Public Property Let Value(byRef uValue)
cValue = uValue
cMonth = Month(uValue)
cYear = Year(uValue)
End Property


Public Property Let CalMonth(byRef uMonth)
cMonth = uMonth
End Property

Public Property Get CalMonth()
CalMonth = cMonth
End Property


Public Property Let CalYear(byRef uYear)
cYear = uYear
End Property

Public Property Get CalYear()
CalYear = cYear
End Property


Public Property Let Fonts(byRef uFonts)
cFonts = uFonts
End Property

Public Property Get Fonts()
Fonts = cFonts
End Property


Public Property Let FontSize(byRef uFontSize)
cFontSize = uFontSize
End Property

Public Property Get FontSize()
FontSize = cFontSize
End Property

Public Property Let ShowNav(byRef uShowNav)
cShowNav = uShowNav
End Property

Public Property Get ShowNav()
ShowNav = cShowNav
End Property


Public Property Let ShowForm(byRef uShowForm)
cShowForm = uShowForm
End Property

Public Property Get ShowForm()
ShowForm = cShowForm
End Property


Public Property Let ShowDate(byRef uShowDate)
cShowDate = uShowDate
End Property


Public Sub Display
If cShowNav or cShowForm Then

Select Case request("CalAction")

Case "back"
cYear = request("currYear")
If request("currMonth") < 1 Then
cMonth = 12
cYear = request("currYear") - 1
Else
cMonth = request("currMonth")
End If
Case "forward"

cYear = request("currYear")
If request("currMonth") > 12 Then
cMonth = 1
cYear = request("currYear") + 1
Else
cMonth = request("currMonth")
End If
Case "goto"

cMonth = request("currMonth")
If request("currYear") <> "" Then
cYear = Int(request("currYear"))
End IF

End Select
End If


cDay = Weekday(arrMonths(cMonth) & "/" & 1 & "/" & cYear)

Days = DaysInMonth()
If cBorder Then%>
<table border="0" cellpadding=0 style="width:100%;">
<tr>
<td bgcolor="#FFFFFF">
<%End If%>
<table border="0" cellspacing=1 cellpadding=1 style="width:100%;">
<tr>
<%If cShowNav Then%>

<td align="center" class="caldateprev"><a href="<%= Request.ServerVariables("SCRIPT_NAME") %>?CalAction=back&currMonth=<%=cMonth - 1%>&currYear=<%=cYear%>" style="text-decoration:none;" class="caldate">«</a></td>
<td colspan="5"align="center" class="caldate"><%=cYear%>년 <%=arrMonths(cMonth)%>월</td>
<td align="center" class="caldatenext"><a href="<%= Request.ServerVariables("SCRIPT_NAME") %>?CalAction=forward&currMonth=<%=cMonth + 1%>&currYear=<%=cYear%>" style="text-decoration:none;" class="caldate">»</a></td>

<%Else%>
<td colspan="7"align="center" bgcolor="#666666"><font color="#FFFFFF" size=<%=cFontSize%> face="<%=cFonts%>"><b><%=arrMonths(cMonth) & " " & cYear%></b></font></td>

<%End If%>
</tr>
<tr>
<td class="yoiltitle">일</td>
<td class="yoiltitle">월</td>
<td class="yoiltitle">화</td>
<td class="yoiltitle">수</td>
<td class="yoiltitle">목</td>
<td class="yoiltitle">금</td>
<td class="yoiltitle">토</td>
</tr>
<tr>
<%i = 1
For j = 1 to cDay - 1%>
<td class="calempty"></td>
<%If i > 6 Then
response.write("</tr><tr>")
i = 0
End If
i = i + 1
Next
For j = 1 to Days%>
<td class="calday <% If i=1 Then %>sunday<% ElseIf i=7 Then %>saturday<% End if %>"><%=j%></td>
<%If i > 6 And j <= Days - 1 Then
response.write("</tr><tr>")
i = 0
End If
i = i + 1
Next
If i > 1 Then
For m = i to 7%>
<td class="calempty"></td>
<%Next
End IF%>
</tr>
</table>
<%If cBorder Then%>
</td>
</tr>
</table>
<%End If
If cShowForm Then BottomForm
End Sub


Private Sub BottomForm%>
<table border="0" cellspacing=1 cellpadding=1 width=200>
<form method="GET" action="<%= Request.ServerVariables("SCRIPT_NAME") %>">
<tr>
<td align="right" width="25%"><font color="#000000" size=<%=cFontSize%> face="<%=cFonts%>"><b>Month</b></font></td>
<td>
<select name="currMonth">
<%For i = 1 to 12%>
<option value=<%=i%><%If i = Int(cMonth) Then response.write " Selected"%>><%=arrMonths(i)%></option>
<%Next%>
</select>
</td>
<td align="right" width="25%"><font color="#000000" size=<%=cFontSize%> face="<%=cFonts%>"><b>Year</b></font></td>
<td><input type="text" name="currYear" maxlength=4 size=4  value="<%=cYear%>"></td>
</tr>
<tr><td colspan=4 align="right"><input type="submit" value="GO"></td></tr>
<input type="hidden" name="calAction" value="goto">
</form>
</table>
<%
End Sub

Private Function DaysInMonth()
Select Case cMonth
Case 1,3,5,7,8,10,12
DaysInMonth = 31
Case 4,5,6,9,11
DaysInMonth = 30
Case 2
If cYear Mod 4 Then
DaysInMonth = 28
Else
DaysInMonth = 29
End If
Case Else
Exit Function
End Select
End Function
End Class
%>


2. calendar.asp

<!--#include virtual="/lib/clsCalendar.asp"--> 

<html> 

<head> 

<title>Calendar</title>

<style type="text/css">

.yoiltitle {

text-align:center;

font-size:12px;

color:#ffffff;

padding:5px;

background:#5E9253;

}


.sunday {

color:red;

}


.saturday {

color:blue;

}


.calempty {


}


.calday {

border:1px solid #c4c4c4;

width:14%;

background:#F8FAEE;

font-size:12px;

padding:5px;

height:50px;

vertical-align:top;

}


.caldate {

font-size:16px;

font-weight:bold;

color:#5E9253;

font-family:'굴림';

padding:10px;

}

</style>

</head> 

<body> 

<div align="center"> 

<% 

Set myCal = New Calendar 

mycal.border=false 'Display Border around Calendar 

mycal.value = Now 'Sets Current Date 

mycal.calMonth = month(date) 'Sets Current Month 

mycal.calYear = year(date) 'Sets Current Year 

mycal.fonts = "Tahoma" 'Sets Font 

mycal.fontSize=2 'Sets Font Size 

mycal.showDate = True 'Not yet implemented 

mycal.showNav =True 'Show prev and next Navigation Links 

mycal.showForm = False 'Show Month and Year form 

mycal.display 'Display Calendar 

Set myCal = Nothing 

%> 

</div>

<div style="height:30px;"></div><!-- iframe에서 하단이 짤리지 않도록 추가 -->

</body> 

</html>


'ASP' 카테고리의 다른 글

쿠키(Cookies) 중복 체크 및 처리  (0) 2015.11.07
ASP 쿠키 로그인/로그아웃  (0) 2015.07.21
년월의 마지막 날짜(일) 구하기  (0) 2015.07.18
ASP 이미지 가로, 세로 크기 구하기  (0) 2015.01.19
페이지 초기번호  (0) 2015.01.04

마우스 클릭 위치 좌표값

JAVASCRIPT 2015. 8. 21. 15:37 Posted by Dayis

function xypos(){ 

var ua = window.navigator.userAgent;

if (ua.indexOf('Chrome') != -1) {

posX = document.body.scrollLeft+event.clientX; 

posY = document.body.scrollTop+event.clientY; 

} else {

posX = document.documentElement.scrollLeft+event.clientX; 

posY = document.documentElement.scrollTop+event.clientY; 

}


※ IE는 body를 인식 못 하고, Chorme은 documentElement를 인식 못 함~!!!

div 태그 내 말줄임표 적용

CSS 2015. 8. 3. 05:34 Posted by Dayis

<div style="width:넓이;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">글내용</div>