1. 스프링 XML 설정

 <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">

<property name="messageConverters">
<list>
<bean
class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8</value>
</list>
</property>
</bean>
</list>
</property>
</bean>

 설명

리턴값중 text 일경우 UTF-8형태를 가추라는 부분

 

 

 2. 전송부 jsp - script

 

function fn_Ajax(){
$.ajax({
type: 'post'
, async: true
, url: '/admin/templet/templetAjax.do'
, data: $("#listForm").serialize()
, beforeSend: function() {
//$('#ajax_load_indicator').show().fadeIn('fast');
//alert("1");
}
, success: function(data) {
// var response = data.trim();
// console.log("success forward : "+response);
// 메세지 할당
alert(data);
//alert(response);
/*
switch(response) {
case "nomatch":
msg = "아이디 또는 비밀번호가 일치하지 않습니다."; break;
case "fail":
msg = "로그인에 실패 했습니다."; break;
default :
msg = "존재하지 않는 사용자입니다."; break;
} */
}
, error: function(data, status, err) {
alert('서버와의 통신이 실패했습니다.');
}

, complete: function() {
//$('#ajax_load_indicator').fadeOut();
// alert("2");
}

});



}

 설명

jsp 단 스크립트로 전송하는 AJAX 부분  JQUERY 이용 하였다. 

 

 

 3. JAVA 구현 및 RESPON 부분

 

@RequestMapping(value="/admin/templet/templetAjax.do", method = RequestMethod.POST)
public @ResponseBody String getTime(@ModelAttribute("templetVO") TempletVO templetVO,@ModelAttribute("SessionVO") SessionVO sessionVO) {
String result = "Time for is " + new Date().toString();
return result;
}

 설명

 위함 수부분에 이노테이션설정

 

 

 

 1. 체크박스 선택 유무   :::::   방법 1

 var iCkecked = 0 ;
   $("input[name^=ckbTemplet]").each(function(){
        if(this.checked){
         iCkecked++;
        }
       });
   if(iCkecked ==0 ){
    modal.alert(" 파일을 선택해주세요.");
    return;
   }

 

 체크박스 선택 유무 ::::: 방법 2

 

 $('input:checkbox[name=userGroup]:checked').length

 

 

 라디오 값 가져오기
 
$('input:radio[name=timeType]:checked').val()

 

 

 

 

 2.  trim

  var str = $.trim(value);

 

 

 

3. 선택된 값 읽기

 

$("#select_box option:selected").val();
$("select[name=selectbox]").val();

jQuery로 선택된 내용 읽기
$("#selectbox option:selected").text();

 

 

 

 

 

 

 

http://hanjiq.egloos.com/2358924 기초 예제

http://pat.im/906 -박스 서서히 사라지는 예제

http://rubis.tistory.com/294  ajax 예제

http://leandrovieira.com/projects/jquery/lightbox/ 이미지 박스에 하이라이트

http://www.mimul.com/pebble/default/2007/11/10/1194695220000.html  이미지 로더 ? 반만 다운후 다보이게

포문

 <html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript"
 src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript">    function test() {        var a = 0;        var su =1;        $('div:[id^=div]').each(//각각div:안에 있는  div로 시작()^=)하는 id 호출함                function(){                    a +=0.25;//this는 자바 속성인데 $(안에 들어가면 jquery 추가됨)                    $(this).html(su++).css('background', 'rgba(255,0,0,'+a+')')                    .css('textAlign', 'center');//html(이안에 html로 쓰겠다는 소리)                })    }</script>
</head>
<body>
 <input type="button" value="바꾸기" onclick="test()">
 <div id="div1" style="border: 1px dotted; width: 300px; height: 50px;"></div>
 <div id="div2" style="border: 1px dotted; width: 300px; height: 50px;"></div>
 <div id="div3" style="border: 1px dotted; width: 300px; height: 50px;"></div>
 <div id="div4" style="border: 1px dotted; width: 300px; height: 50px;"></div>
</body>
</html>

 

http://findfun.tistory.com/404  --예제 많음

--> http://findfun.tistory.com/421  ---- trim

--> http://findfun.tistory.com/414   ----- 오브젝트 배열로 만들기 ~

--> http://findfun.tistory.com/410 ---숫자 체크

--> http://findfun.tistory.com/408 -- isPlainObject()  오브젝트 가 맞는지 확인

--> http://findfun.tistory.com/403 -- each 반복문 ..

--> http://findfun.tistory.com/401   -- ajax 할때 파라메타 쉽게 만들기

--> http://findfun.tistory.com/400 -- ajax post

http://blog.naver.com/tweety2411?Redirect=Log&logNo=100161568560   ajax 파일 업로드

http://malsup.com/jquery/form/#file-upload 파일 업로드

http://stackoverflow.com/questions/2259551/spring-3-0-making-json-response-using-jackson-message-converter?rq=1  

전자정부프레임워크 공통컴포넌트 첫난관! 전자정부프레임워크

2012/04/09 17:25

복사http://blog.naver.com/9942077/150136043232

에러 내용 :

Error configuring application listener of class org.springframework.web.context.ContextLoaderListener


전자정부프레임워크의 개발 준비를 마친 후 기본 프로젝트를 생성하고 공통컴포넌트를 추가하면 이와같은 에러가 빡 난다!!


아놔~ 이거 뭐야..


ClassNotFoundException

pom.xml

즉, tomcat을 띄울때 이넘이 jar파일(pom.xml에 설정해준(dependencies로))을

설정


프로젝트의 오른쪽마우스 클릭 -> Properties -> Deployment Assembly -> Add -> Java Build Path Entries -> Next -> Maven Dependencies -> Finish