728x90
반응형
728x90
반응형

 

JSP 파일에서 Jquery로 CSS Control 하기

 

간단하게 div에 배경색을 부여하고 버튼을 클릭하게 되면 배경색을 빨강색 > 검정색으로 변경하는 예제

 

JSP Page

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<body>
    <div id="test1" style="background:red; height:300px;"></div>
    <div id="test2" style="background:blue; height:300px;"></div>
    <button id="changeBtn">배경색깔 바꾸기</button>
    <script type="text/javascript">
        $(document).ready(function() {
            
            $('#changeBtn').click(function(){
                $('#test1').css('background-color''black');
                console.log("맨위 배경색깔이 검정색으로 변경되었습니다.");
            });
 
        });
    </script>
</body>
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

Web Page 

버튼 누르기전 div 배경색깔을 빨강색 파랑색으로 설정함

버튼을 누른 후 div 배경색깔을 빨강색을 검정색으로 변경함

 

 

728x90
반응형

'Web > jQuery' 카테고리의 다른 글

[jQuery] keyup Event Example  (0) 2019.08.25
[jQuery] AJAX 동기 처리 Example  (0) 2019.07.21
[jQuery] Click Event Example  (0) 2019.07.14
[jQuery] AJAX 한글깨짐 해결 Example  (0) 2019.06.23
[jQuery] AJAX 배열전송(Array) Example  (0) 2019.06.22
728x90
반응형

 

jQuery에서 키보드 Event 알아보기

Keyboard Event중 대표적으로 keyup, keydown, keypress가 있음



keyup Event - 키보드에서 무언가 입력을 하다가 손을 떼었을 때 이벤트가 실행

 

jQuery keyup Event Example

 

Jsp Page

1
2
3
4
5
6
7
8
9
10
11
12
<body>
    <input type="text" id="testInput" name="testInput" placeholder="keyup 테스트">
    <script type="text/javascript">
        $(document).ready(function() {
            
            $('#testInput').keyup(function(e) {
                console.log("키보드에서 손을 뗌");
                console.log("마지막 누른 키보드 ASC 값 : " + e.keyCode);
            });
        });
    </script>
</body>
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

Web Page 

 

 

728x90
반응형

'Web > jQuery' 카테고리의 다른 글

[jQuery] CSS Control Example  (2) 2019.08.25
[jQuery] AJAX 동기 처리 Example  (0) 2019.07.21
[jQuery] Click Event Example  (0) 2019.07.14
[jQuery] AJAX 한글깨짐 해결 Example  (0) 2019.06.23
[jQuery] AJAX 배열전송(Array) Example  (0) 2019.06.22
728x90
반응형

 

리눅스로 로그의 기록을 실시간으로 볼려면 tail을 사용해야 한다.

 

 

옵션

  • [-f] 파일의 마지막 10라인 실시간으로 계속 출력
  • [-F] 파일변동시 실시간 출력 & 특정시간 지난 후 파일 변동시 새로운 파일 오픈해서 출력
  • [-n n] 파일의 마지막부터 n만큼의 라인을 출력
  • [-n +n] 파일의 첫번째부터 n번째 이후 라인을 출력
  • 옵션 생략 가능

 

 

실시간 로그 기록 보기

tail [-f] 파일명

test.log 파일 실시간으로 보기

ex) tail -f test.log

 

 

로그 종료하기

Ctrl + C

 

 

728x90
반응형
728x90
반응형

 

Window에 있는 파일을 Linux서버에 파일 업로드 시키기

  • 알FTP 사용하기 - 2013.05.30 업데이트 된 5.33이 마지막 버전, 서비스 종료
  • 파일질라 사용하기 (추천) - 공개용 소프트웨어

 

알FTP 사용하기

1. 알FTP 파일 다운로드 

ALFTP533.exe
4.60MB

 

2. 알FTP 실행화면

3. 접속하기 클릭

 

3. FTP주소, 사용자 ID, 비밀번호 입력후 확인버튼 클릭

 

4. 연결(접속) 성공

 

 

 

파일질라 사용하기

1. 파일질라 파일 다운로드

https://filezilla-project.org/download.php?type=client

 

Download FileZilla Client for Windows (64bit)

Download FileZilla Client for Windows (64bit) The latest stable version of FileZilla Client is 3.43.0 Please select the file appropriate for your platform below. Please select your edition of FileZilla Client FileZilla ProFileZilla with manualFileZilla Sta

filezilla-project.org

 

2. 빨간 밑줄 부분의 버튼을 클릭해 사이트 관리자 열기

 

3. 새 사이트 버튼 클릭하기

 

4. 호스트, 사용자, 비밀번호 입력 후 연결 버튼 클릭

5. 연결(접속) 성공

 

728x90
반응형
728x90
반응형

 

리눅스 서버에 Window에서 putty를 이용해 원격으로 접속하기

 

putty란 ?

  • SSH접속을 시도할 때 윈도우에서 원격으로 리눅스에 접속하게 해주는 가상터미널 프로그램
  • SSH -> Secure Shell

 

 

1. Putty Download 하기

https://www.putty.org/

 

Download PuTTY - a free SSH and telnet client for Windows

Is Bitvise affiliated with PuTTY? Bitvise is not affiliated with PuTTY. We develop our SSH Server for Windows, which is compatible with PuTTY. Many PuTTY users are therefore our users as well. From time to time, they need to find the PuTTY download link. W

www.putty.org

 

2. Putty 실행하기

 

3. Host Name(or IP address)에 접속하고자 하는 IP입력

4. Port 22

5. Saved Sessions에 원하는 이름 적은 후 Save 누르기

6. Open 클릭하기

7. ID, PW 입력하기 (주의 : PW는 입력창 안보임)

728x90
반응형
728x90
반응형

 

프로그래밍 소스코드 이쁘게 올리기

  • Color Scripter 홈페이지 이용하기

https://colorscripter.com/

 

Color Scripter

Simple & Flexible Syntax HighLighter

colorscripter.com

 

 

Color Scripter Copy Error 해결방법

  • Color Scripter Page > 세부설정 클릭 > HTML태그 자체복사 체크 > 저장

 

이후 다시 '클립보드에 복사'를 누른 후 Ctrl + V 를 누를 경우 글작성이 잘 된다.

 

아래와 같은화면이 뜨면

 

 

2분할 된 우측화면 클릭 > 열지우기 클릭

정돈된 코드확인 하기

 

728x90
반응형
728x90
반응형

 

Spring Model, ModelMap, ModelAndView 차이점

 

Model, ModelMap Vs ModelAndView 차이점

  • 데이터만 저장한다 vs 데이터와 이동하고자 하는 View Page를 같이 저장한다

 

 

Model, ModelMap 공통점

  • model.addAttribute("변수명");
  • modelMap.addAttribute("변수명");
  • 둘 다 addAttribute를 사용함
  • Model or ModelMap에 데이터만 저장 후 View에서 사용목적

 

Model, ModelMap 차이점

  • Model - 인터페이스
  • ModelMap - 클래스

 

Java Controller

1
2
3
4
5
6
7
8
9
10
11
12
13
 
@RequestMapping(value = "/test.do")
public String test(HttpServletRequest request, Model model, ModelMap modelMap){
        
    String modelStr = "Model Test";
    String modelMapStr = "ModelMap Test";
    
    model.addAttribute("modelVar", modelStr);
    model.addAttribute("modelMapVar", modelMapStr);
        
    return "temp/test";
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

JSP

1
2
3
4
5
<body>
    Model 저장한 값 : <input type="text" value="${modelVar }"/><br/>
    ModelMap 저장한 값 : <input type="text" value="${modelMapVar }"/>
</body>
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

Web Page

 

 

ModelAndView

  • addObject를 통해 데이터를 저장
  • setViewName을 통해 이동하고자 하는 View를 저장
  • 메소드 안에서 ModelAndView mv = new ModelAndView(); 
  • return type ModelAndView 

 

Java Controller

1
2
3
4
5
6
7
8
9
10
11
@RequestMapping(value = "/test.do")
public ModelAndView test(HttpServletRequest request, ModelAndView mv){
        
    String modelAndViewStr = "ModelAndView Test";
    
    mv.addObject("modelAndViewVar", modelAndViewStr);
    mv.setViewName("temp/test");
        
    return mv;
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

JSP

1
2
3
4
<body>
    ModelAndView 저장한 값 : <input type="text" value="${modelAndViewVar }"/><br/>
</body>
 
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter

 

Web Page

728x90
반응형
728x90
반응형

 

Linux 파일, 디렉토리 소유권 변경하기

  • 파일 소유권 변경
  • 디렉토리 소유권 변경
  • 하위디렉토리까지 소유권 변경

 

chown = change owner

 

root 권한일때 소유권 변경할 수 있다.

 

파일 소유권 변경하기

chown 소유권자:그룹식별자 소유권을 변경하고 싶은 파일명

ex) chown temp:temp test.sh

 

 

디렉토리 소유권 변경하기

chown 소유권자:그룹식별자 소유권을 변경하고 싶은 디렉토리명

현재디렉토리에 존재하는 test디렉토리의 소유권을 변경 하고 싶을 경우

ex) chown temp:temp test

 

 

하위디렉토리까지 소유권 변경하기

chown -R 소유권자:그룹식별자 소유권을 변경하고 싶은 디렉토리명

현재디렉토리에 존재하는 test디렉토리 및 하위 디렉토리&파일의 소유권을 모두 변경 하고 싶을 경우

ex) chown -R temp:temp ./test

728x90
반응형

+ Recent posts