상태를 표시해주는 Seekbar는 ProgressBar를 확장한 것이다. ProgressBar의 속성을 가지고 있으면서도 사용자가 이 SeekBar의 값을 조절할 수 있도록 하고 있다. 주로 볼륨 조절이나, 동영상 재생 시에 재생 위치 조절을 위해 사용된다. SeekBar클래스의 setOnSeekBarChangeListener메서드를 통해 SeekBar.OnSeekBarChangeListener를 구현한 클래스를 메서드의 인자로 등록해서 SeekBar의 상태가 바뀔 때마다 호출되도록 할 수 있는 기능을 작성할 수 있다. 액티비티 codepublic class MainActivity extends AppCompatActivity { SeekBar bar; @Override protected void onC..
스프링 시큐리티를 사용한다.ajax로 요청하는 어떤 url(별칭A)로의 접근을 시큐리티가 로그인 한 사용자만 접근하도록 제한하고 있다.한 페이지에서 장시간 사용하지 않아 세션이 만료되어 로그아웃 되었다.하지만 페이지는 로그인한 페이지 그대로 보여 A로 접근하는 ajax를 실행했지만 실패한다.. 이런 이유로다음과 같은 상황에서 ajax를 실행하면 로그인 화면으로 리다이렉트 하도록 한다. 필터클래스를 구현한 bean을 등록하고, security:http엘리먼트 하위에 custom-filter엘리먼트를 등록한다. ..... ..... Colored by Color Scriptercs 필터 클래스의 구현체인 AjaxSessionTimeoutFilter클래스를 만든다.public class AjaxSessionT..
Stream을 사용하면 배열, 컬렉션 클래스 또는 파일에 저장된 데이터들을 같은 방식으로 접근하고 다룰 수 있다. ex) 컬렉션 클래스와 배열을 스트림으로 선언 ArrayList list = new ArrayList(); list.add("전북"); list.add("익산시"); list.add("신동"); list.add("영등동"); list.add("부송동"); Stream stream = list.stream(); //컬렉션 클래스를 스트림으로 선언하는법 //2번째 요소까지만 출력 stream.limit(2).forEach(System.out::println); int[] arr = {1,2,3}; IntStream iStream = Arrays.stream(arr); //배열을 스트림으로 선언하..
현재 지정된 단축 명령 확인#aliascs alias 등록 방법명령행에서 바로 등록(재 접속시 더이상 사용할 수 없다.)#alias remove='rm -rf'cs 현재 사용자만 사용하도록 등록vi ~/.bash_profile #파일이 열리면..아래 명령을 적절한 위치에 등록 alias remove='rm -rf' #저장하고 나와서 source ~/.bashrccs로그아웃 후 재접속을 해야 등록한 alias사용가능 모든 사용자가 사용하도록 등록위의 ~/.bash_profile파일 대신에 /etc/profile파일에 명령어 등록역시 재접속을 해야 사용가능