반응형

PrintWriter out = response.getWriter();

를 사용할때 페이지자체가 한글깨짐현상이 발생을 하게된다.

해결방법으로 간단하게

 

response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");

를 위에 코딩해준후에

 

out.println("내용");

 

을 사용하게되면 페이지가 한글이깨지않는다.

반응형

'IT관련 > JavaScript' 카테고리의 다른 글

이미지 파일 미리보기 기능구현  (0) 2014.08.21
Servlet alert 사용  (0) 2014.06.21
SELECTBOX OPTION SCRIPT  (0) 2014.06.13
블로그 이미지

Mr.비타민

,
반응형


1. jQuery로 선택된 값 읽기

 

$("#selectBox option:selected").val();

$("select[name=name]").val();

 

2. jQuery로 선택된 내용 읽기

 

$("#selectBox option:selected").text();

 

3. 선택된 위치

 

var index = $("#test option").index($("#test option:selected"));

 

4. Addoptions to the end of a select

 

$("#selectBox").append("<option value='1'>Apples</option>");

$("#selectBox").append("<option value='2'>After Apples</option>");

 

5. Addoptions to the start of a select

 

$("#selectBox").prepend("<option value='0'>Before Apples</option>");

 

6. Replaceall the options with new options

 

$("#selectBox").html("<option value='1'>Some oranges</option><option value='2'>MoreOranges</option>");

 

7. Replaceitems at a certain index

 

$("#selectBox option:eq(1)").replaceWith("<option value='2'>Someapples</option>");

$("#selectBox option:eq(2)").replaceWith("<option value='3'>Somebananas</option>");

 

8. 지정된 index값으로 select 하기

 

$("#selectBox option:eq(2)").attr("selected", "selected");

 

9. text 값으로 select 하기

 

$("#selectBox").val("Someoranges").attr("selected", "selected");

 

10. value값으로 select 하기

 

$("#selectBox").val("2");

 

11. 지정된 인덱스값의 item 삭제

 

$("#selectBox option:eq(0)").remove();

 

12. 첫번째 item 삭제

 

$("#selectBox option:first").remove();

 

13. 마지막 item 삭제

 

$("#selectBox option:last").remove();

 

14. 선택된 옵션의 text 구하기

 

alert(!$("#selectBox option:selected").text());

 

15. 선택된 옵션의 value 구하기

 

alert(!$("#selectBox option:selected").val());

 

16. 선택된 옵션 index 구하기

 

alert(!$("#selectBox option").index($("#selectBox option:selected")));

 

17. SelecBox 아이템 갯수 구하기

 

alert(!$("#selectBox option").size());

 

18. 선택된 옵션 앞의 아이템 갯수

 

alert(!$("#selectBox option:selected").prevAl!l().size());

 

19. 선택된 옵션 후의 아이템 갯수

 

alert(!$("#selectBox option:selected").nextAll().size());

 

20. Insertan item in after a particular position

 

$("#selectBox option:eq(0)").after("<option value='4'>Somepears</option>");

 

21. Insertan item in before a particular position

 

$("#selectBox option:eq(3)").before("<option value='5'>Someapricots</option>");

 

22. Gettingvalues when item is selected

 

$("#selectBox").change(function(){

           alert(!$(this).val());

           alert(!$(this).children("option:selected").text());

});


출처 : http://blog.daum.net/twinsnow/124

반응형

'IT관련 > JavaScript' 카테고리의 다른 글

이미지 파일 미리보기 기능구현  (0) 2014.08.21
Servlet alert 사용  (0) 2014.06.21
PrintWriter 사용시 인코딩 (한글깨짐)  (0) 2014.06.21
블로그 이미지

Mr.비타민

,
반응형


안드로이드 개발을 하다보면 화면전환이 기본설정으로만 되어 있어서 밋밋함이 느껴질때가 많다.

그래서 좀 세련되면서도 이쁘고 깜찍하게(?).... 애니메이션효과를 넣을 수가 있다.


액티비티를 Intent에 담아서 전환할때 한줄소스와 애니메이션 xml파일만 있다면 너도 나도 멋지게 액비티비 전환을 구현가능하다.


일단 기본적으로 

Intent intent = new Intent(getApplicationContext(), FirstGame.class);
startActivity(intent);


기본적인 액티비티 전환방법이다!! 여기에다가 overridePendingTransition메소드 하나만 넣어주게되면 A->B로 전환될때 애니메이션이 들어가게된다.

 
Intent intent = new Intent(getApplicationContext(), FirstGame.class);
startActivity(intent);
overridePendingTransition(R.anim.fade, R.anim.cycle_7);


fade는 희미하게 조금씩 밝아지면서 cycle은 A->B로 갈때와 B->A로 갈때 모두 적용하게 만들수 있다. 

 애니메이션 xml은 파일은 첨부에다가 넣어두겠다!


xml폴더에 있는 효과들은 아마 영어를 해석한다면 사용하는데 큰 무리가 없을 것이다.

폴더의 위치는 res폴더에 넣어서 리소스로서 사용하면 된다.



anim.zip



반응형
블로그 이미지

Mr.비타민

,