#java

밍맹구밍맹구· 3개월

질문react 외주맡겼는데 2500줄 넘게왔습니다. 원래 이런건가요?

React는원래 컴포넌트별로 나눠서 처리하고 app.jsx는 컴포넌트 경로만 되어있는걸로 알고있는데 요즘 트랜드가 이런건지 리팩토링요청을 해야할지 궁금합니다..!
294
4
0
닥터핸
닥터핸·2024-12-26
요즘 React 트렌드는 컴포넌트를 작고 단순하게 분리하는 것입니다. 보통은 100~200줄을 넘지 않는 것이 좋습니다. 2500줄을 넘는다는 것은 컴포넌트가 제대로 분리가 안되어있거나, 라이브러리를 제대로 활용하지 않았을 것 같습니다. 리팩토링을 요청하는 것이 좋을 것 같고, 요청한다면 아래 내용으로 요청하면 될 것 같습니다. 컴포넌트는 가능하면 한가지...
뎁스_3060뎁스_3060· 10개월

질문12-Jun-2024 02:22:02.119 경고

12-Jun-2024 02:22:02.119 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.121 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.122 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.123 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.124 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.125 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.126 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.127 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.129 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.130 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:02.132 경고 [http-nio-8007-exec-26420] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/cmm/fms/selectFileInfs_n.do] to the cache for web application [] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 12-Jun-2024 02:22:10.132 정보 [ContainerBackgroundProcessor[StandardEngine[kidijsp]]] org.apache.catalina.webresources.Cache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [] - consider increasing the maximum size of the cache. After eviction approximately [5,417,457] KB of data remained in the cache. 12-Jun-2024 02:22:20.134 정보 [ContainerBackgroundProcessor[StandardEngine[kidijsp]]] org.apache.catalina.webresources.Cache.backgroundProcess The background cache eviction process was unable to free [10] percent of the cache for Context [] - consider increasing the maximum size of the cache. After eviction approximately [5,417,457] KB of data remained in the cache. 어떻게 해야하나요..뭘 봐야하나요? ㅜㅜ 죄송합니다.
110
0
yj23124yj23124· 3년

질문안드로이드 뷰가 inflate 되지 않습니다.

layout(.xml) 파일에서 몇 가지 수정하는데 애뮬레이터나 핸드폰 연결해서 적용해봤는데 변경사항이 저장이 안됐습니다. 그래서 다른 코드가 잘못됐나? 하고 지우고 지우다 그냥 딱 기본 코드만 남겨놓고 변경했는데도 여전히 변화가 없습니다.   사진으로 보면 무슨 말인지 확실히 알 수 있습니다. 왼쪽은 제가 원하는 결과물이고 오른쪽은 애뮬레이터에 표시되는 화면입니다.    그리고 왼쪽과 같이 layout(.xml)파일을 수정하고 애뮬레이터 terminate 시키고 다시 실행시킨게 오른쪽 사진입니다.  동작을 안합니다..   class EditProfileActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_edit_profile) } } 위의 코드는 해당 코틀린 코드입니다. 가장 기본적인 코드만 남겼는데도 위와 같이 문제가 일어납니다.   해당 파일을 지우고 다시 만드는 방법도 있겠지만, 이 layout 말고도 다른 곳에서도 위와 같은 문제가 발생해서 가능하다면 이유를 알아서 삭제하지 않고 해결하고 싶습니다. 왜 이런 문제가 발생하는지 아시는 분 계실까요?
1.5K
2
1
0
무린
무린·2022-05-18
안드로이드 스튜디오에서 File> Invalid cache/Restart > Invalidate and Restart 를 실행해보시기 바랍니다.
새벽이슬새벽이슬· 3년

질문자바 쪽으로 이직 준비중입니다.

제가 개발 경력이 asp 3년, asp.net  웹폼 5년, .net core mvc 3년을 했습니다. (동시에 여러 언어를 같이 했기 때문에 실제로는 asp는 10년이 넘었고, .net웹폼도 8년이 넘은거네요.) 모두 윈도우 기반으로 C# 웹 개발을 주로 개발했죠. DB는 MS-SQL을 주로 사용했습니다. 제로보드 홈페이지 제작 유지보수도 해서 PHP도 어느 정도는 다룰 수 있고, MySQL도 해봤습니다. 자바의 경우, 사회 첫발을 내딛기전 학원에서 6개월, 그리고 첫 직장에서 7개월 했습니다. 근데 이번에 이직을 준비중인데 C#은 거의 없고, 대부분 자바 채용이 많네요. 그래서 틈틈히 Java Spring 공부도 하긴 했습니다. 나이는 40대 초반입니다. 지금 자바 쪽으로 이직을 하려고 하는데 가능하긴 할까요? 또한 자바 쪽으로 이직하는게 괜찮을까요? 자바의 경우는 자바 쪽 경력이 많지 않은 점, 나이, 연봉 문제로 잘 안 뽑아줄 수도 있어서 가능하면 단기 프로젝트를 할 수 있는 SI로 알아보고 투입했다가 경력 쌓이면 정규직으로 알아볼까도 생각 중 입니다. 선배, 후배님들 좋은 의견, 조언 있으시면 부탁드립니다.
1.5K
1
1
0
kimho
kimho·2021-10-26
제 생각에는 말씀하신 경력이면 자바쪽 이직도 충분하실 것 같습니다. 현재 자바로 진행하는 업체나 프로젝트는 여전히 많기 때문에 조금만 노력해서 찾아보면 괜찮은 업체나 프로젝트들을 찾으실 수 있습니다. 규모가 좀 큰 업체임에도 애타게 개발자를 구하고 있는 업체들도 많이 있습니다. 40대 초반이라도 관련 경력이 있으시기 때문에 아직은 이 분야에서는 이직...
무린무린· 4년

자바로 만든 베스트 게임 7가지

7 Best Games Written in Java - Java Code Geeks - 2023 Interested to learn about Java? Check our article presenting the 7 best games of all time written in java. www.javacodegeeks.com 인기있는 게임 가운데 의외로 자바로 만든 게임들이 있습니다.   1. Watfu https://www.wakfu.com/en/mmorpg Wakfu는 Ankama Games에서 개발한 전술 턴 기반 MMORPG   2. Worms: A Space Oddity https://worms.fandom.com/wiki/Worms:_A_Space_Oddity Wii를 위한 포병 전술 게임   3. Saints Row 2 (Mobile) https://saintsrow.fandom.com/wiki/Saints_Row_2_(mobile) 엑스박스 360외에도 플레이스테이션 3 버전이 먼저 2008년 10월에 발매되었고, 이후 2009년에 마이크로소프트 윈도우 버전으로도 이식되었다.   4. SimCity https://www.origin.com/kor/ko-kr/store/simcity/simcity 엔딩이 없는 타이쿤형 도시 건설 게임 시리즈로, 컴퓨터용과 비디오 게임 콘솔용이 있다   5. Spiral Knights https://www.spiralknights.com/ Three Rings Design에서 만든 대규모 멀티 플레이어 온라인 게임으로 현재 Gray Havens가 소유. 무료로 플레이 할 수있는 Java 기반 게임은 2011 년에 출시되었으며 여전히 가끔 업데이트됨.   6. RuneScape https://www.runescape.com/splash 대규모 다중 사용자 온라인 롤플레잉 게임으로 자스 게임즈 스튜디오가 개발, 출판하였다. 자바 기반의 클라이언트 측에서 제공되는 그래픽 웹 게임으로, 3차원 렌더링도 포함하고 있다.   7. Minecraft https://www.minecraft.net/ko-kr 두말하면 잔소리. 스웨덴의 게임 개발사 모장 스튜디오가 제작한 샌드박스 비디오 게임이다. 마르쿠스 페르손이 자바 프로그래밍 언어로 개발해 2009년 5월 처음 대중에 공개했으며, 옌스 베리엔스텐이 총괄 디자이너직을 이어받으면서 2011년 11월 18일 정식판이 출시됐다.    
7.4K
1
0
모니타모니타· 4년

질문spring에 pebble java 설정 도와주세요ㅠㅠ

spring에서 pebble사용을 위해서 자바 설정을 하는 중인데,, 계속 똑같은 에러가 뜹니다! 도와주세요ㅠㅠ   일단, 제가 설정한 과정과 에러에 대해서 순차적으로 보여드리겠습니다.   1. pom.xml에 dependency 추가 2. spring -> appServlet -> servlet-context.xml 경로에 bean 추가 및 viewResolver 설정 3. 자바에 PebbleEngineFactory.java / ServletContextFactory.java 생성 4. 컨트롤러 생성 후 지정한 파일 return (ex : return "index") 5. base.html, index.html 파일 6. run as 후 에러 내용   이제 제가 생성한 파일 내용을 위의 순서에 맞게 보여드리겠습니다. 문제가 되는 부분 체크해주시면 감사하겠습니다!   1. pom.xml에 pebble 디펜던시 추가(버전은 3.1.5) 2. servlet-context.xml에 빈 생성 ( 오류 보면 뷰리졸버의 .html를 읽지 못하는 것 같아요)   3. 자바에 PebbleEngineFactory.java / ServletContextFactory.java 생성 3-1. PebbleEngineFactory 파일 생성   3-2. ServletContextFactory 파일 생성   4. 컨트롤러 생성 후 지정한 파일 return   5. html 파일도 보여드리겠습니다.   6. 그 후 에러 내용입니다.   >> LoaderException 이라고 해서 계속 오류뜨네요ㅠ 도와주세요!
1.2K
0

질문java 완전 초보 질문드립니다ㅠㅠ

예제 풀이를 하고 있는데 갑자기 머리가 멍해지고 머리가 하나도 안돌아가네요... 독학으로 하는지라... 문제 예제가 컨트롤러에 1~10까지 정수 저장하는 int[] arr을 생성해서 arr 키 이름에 저장하는 컨트롤러 클래스를 작성한 다음 이 키 이름을 참조해서 홀수들의 누적합을 구하는 jsp 뷰페이지를 작성하라는데...   뭔가 이 밑에 문제에 대해서 설명해주실 수 있을까요? 어제부터 오늘까지 혼자 해보려고 안간힘을 쓰다가 도저히 안될 것 같아서 질문드립니다 ㅠㅠ 
1.1K
1
0
피토니
피토니·2021-08-09
헐.. 어디서 나온 문제인지 몰라도 문제를 참 복잡하게 낸 것 같네요..
사용자 프로필· 4년

질문Android Studio에서 Navigation Drawer하려는 과정에서 문제가 있습니다!

Toolbar의 햄버거 버튼을 누르면 메뉴가 나오는 Navigation Drawer를 만들기 위해 activity_main.xml의 NavigationView 태그를 주석처리하면 아래의 사진처럼 실행은 됩니다. 그러나 주석처리를 없애면 바로 튕겨버립니다.. activity_main.xml의 NavigationView 태그 위치가 문제인 것 같아서 이리저리 바꿔보았지만, 같은 이유로 계속 강제 종료 되었습니다. 해결방법을 찾고 싶습니다!      Logcat: E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.myapplication, PID: 17929     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)         at android.os.Handler.dispatchMessage(Handler.java:107)         at android.os.Looper.loop(Looper.java:214)         at android.app.ActivityThread.main(ActivityThread.java:7356)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)      Caused by: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView      Caused by: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView      Caused by: java.lang.reflect.InvocationTargetException         at java.lang.reflect.Constructor.newInstance0(Native Method)         at java.lang.reflect.Constructor.newInstance(Constructor.java:343)         at android.view.LayoutInflater.createView(LayoutInflater.java:854)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)         at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)         at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)         at android.view.LayoutInflater.inflate(LayoutInflater.java:682)         at android.view.LayoutInflater.inflate(LayoutInflater.java:534)         at android.view.LayoutInflater.inflate(LayoutInflater.java:481)         at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)         at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)         at com.example.myapplication.MainActivity.onCreate(MainActivity.java:50)         at android.app.Activity.performCreate(Activity.java:7802)         at android.app.Activity.performCreate(Activity.java:7791)         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)         at android.os.Handler.dispatchMessage(Handler.java:107)         at android.os.Looper.loop(Looper.java:214)         at android.app.ActivityThread.main(ActivityThread.java:7356)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Error inflating class TextView     Caused by: android.view.InflateException: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Error inflating class TextView     Caused by: java.lang.UnsupportedOperationException: Can&#39;t convert value at index 2 to dimension: type=0x1         at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:786)         at android.widget.TextView.readTextAppearance(TextView.java:3971)         at android.widget.TextView.<init>(TextView.java:1064)         at android.widget.TextView.<init>(TextView.java:968)         at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100)         at com.google.android.material.textview.MaterialTextView.<init>(MaterialTextView.java:93)         at com.google.android.material.textview.MaterialTextView.<init>(MaterialTextView.java:88)         at com.google.android.material.textview.MaterialTextView.<init>(MaterialTextView.java:83)         at com.google.android.material.theme.MaterialComponentsViewInflater.createTextView(MaterialComponentsViewInflater.java:61)         at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115)         at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)         at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)         at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1061)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)         at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)         at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)         at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)         at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)         at android.view.LayoutInflater.inflate(LayoutInflater.java:682)         at android.view.LayoutInflater.inflate(LayoutInflater.java:534)         at com.google.android.material.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:222)         at com.google.android.material.navigation.NavigationView.inflateHeaderView(NavigationView.java:387)         at com.google.android.material.navigation.NavigationView.<init>(NavigationView.java:241)         at com.google.android.material.navigation.NavigationView.<init>(NavigationView.java:122)         at java.lang.reflect.Constructor.newInstance0(Native Method)         at java.lang.reflect.Constructor.newInstance(Constructor.java:343)         at android.view.LayoutInflater.createView(LayoutInflater.java:854)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)         at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)         at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)         at android.view.LayoutInflater.inflate(LayoutInflater.java:682)         at android.view.LayoutInflater.inflate(LayoutInflater.java:534)         at android.view.LayoutInflater.inflate(LayoutInflater.java:481)         at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)         at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)         at com.example.myapplication.MainActivity.onCreate(MainActivity.java:50)         at android.app.Activity.performCreate(Activity.java:7802)         at android.app.Activity.performCreate(Activity.java:7791)         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)         at android.os.Handler.dispatchMessage(Handler.java:107)         at android.os.Looper.loop(Looper.java:214)         at android.app.ActivityThread.main(ActivityThread.java:7356)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)    MainActivity.java:    public class MainActivity extends AppCompatActivity {     // 툴바     private Toolbar toolbar;     private DrawerLayout drawerLayout;     private NavigationView navigationView;     // 가운데     private ViewPager2 viewPager2;     private DotsIndicator dotsIndicator;     private ArrayList<DataPage> list;     // 바텀네비게이션뷰     private BottomNavigationView bottomNav;     private FragmentManager fragmentManager = getSupportFragmentManager();     private SearchPage fragmentSearch = new SearchPage();     private HomePage fragmentHome = new HomePage();     private CafePage fragmentCafe = new CafePage();     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         // 바텀네비게이션         bottomNav = findViewById(R.id.navigationView);         bottomNav.setOnNavigationItemSelectedListener(new ItemSelectedListener());         this.InitializeLayout(); // 툴바         this.viewpage(); // 뷰페이저         //FragmentTransaction transaction = fragmentManager.beginTransaction();         //transaction.replace(R.id.frameLayout, fragmentSearch).commitAllowingStateLoss();         // 바텀네비게이션     }     //툴바     private void InitializeLayout() {         //toolBar를 통해 App Bar 생성         toolbar = findViewById(R.id.toolbar);         drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);         //navigationView = (NavigationView) findViewById(R.id.nav_view);         setSupportActionBar(toolbar);         ActionBar actionBar = getSupportActionBar();         actionBar.setDisplayShowTitleEnabled(false); // 기존 title 지우기         actionBar.setDisplayHomeAsUpEnabled(true);  // 왼쪽 버튼 사용 여부 true         actionBar.setHomeAsUpIndicator(R.drawable.ic_reorder_white_24dp);  // 왼쪽 버튼 이미지 설정     // 툴바 오른쪽 버튼     @Override     public boolean onCreateOptionsMenu(Menu menu) {         // Inflate the menu; this adds items to the action bar if it is present.         getMenuInflater().inflate(R.menu.menu, menu);         return true;     }     //추가된 소스, ToolBar에 추가된 항목의 select 이벤트를 처리하는 함수     @Override     public boolean onOptionsItemSelected(MenuItem item) {         //return super.onOptionsItemSelected(item);         int id = item.getItemId();         switch (id) {             case android.R.id.home:                 drawerLayout.openDrawer(GravityCompat.START);                 Toast.makeText(getApplicationContext(), "메뉴 버튼 클릭됨", Toast.LENGTH_LONG).show();                 return true;         }         return super.onOptionsItemSelected(item);     }     private void viewpage(){         list = new ArrayList<>();         list.add(new DataPage(R.drawable.sample_1, "Starbucks", 4900));         list.add(new DataPage(R.drawable.sample_2, "Twosome Place", 4100));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         list.add(new DataPage(R.drawable.sample_3, "EDIYA", 3000));         viewPager2 = findViewById(R.id.viewPager2);         viewPager2.setAdapter(new ViewPagerAdapter(list));         dotsIndicator = findViewById(R.id.dots_indicator);         dotsIndicator.setViewPager2(viewPager2);     }     //바텀네비     class ItemSelectedListener implements BottomNavigationView.OnNavigationItemSelectedListener {         @Override         public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {             FragmentTransaction transaction = fragmentManager.beginTransaction();             switch (menuItem.getItemId()) {                 case R.id.searchItem:                     transaction.replace(R.id.frameLayout, fragmentSearch).commitAllowingStateLoss();                     break;                 case R.id.homeItem:                     transaction.replace(R.id.frameLayout, fragmentHome).commitAllowingStateLoss();                     break;                 case R.id.cafeItem:                     transaction.replace(R.id.frameLayout, fragmentCafe).commitAllowingStateLoss();                     break;             }             return true;         }     } } activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout android:id="@+id/drawer_layout"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitsSystemWindows="false"     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"> <!-- @@@@@이 부분만 추가하면 이러한 에러 발생 @@@@@@-->     <com.google.android.material.navigation.NavigationView         android:id="@+id/nav_view"         android:layout_width="200dp"         android:layout_height="match_parent"         android:layout_gravity="start"         android:background="@drawable/side_nav_bar_white"         android:fitsSystemWindows="false"         app:headerLayout="@layout/nav_header_main"         app:menu="@menu/activity_main_drawer"         app:itemTextAppearance="@style/text_size">     </com.google.android.material.navigation.NavigationView> <!-- @@@@@이 부분만 추가하면 이러한 에러 발생 @@@@@@--> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:background="@color/cfb"     tools:context=".MainActivity">     <androidx.appcompat.widget.Toolbar         android:id="@+id/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionBarSize"         android:background="?attr/colorPrimary"         android:elevation="4dp"         android:theme="@style/ThemeOverlay.AppCompat.Dark">         <TextView             android:id="@+id/toolbar_title"             android:text="@string/app_name"             android:textSize="25sp"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="center"/>     </androidx.appcompat.widget.Toolbar>     <FrameLayout         android:id="@+id/content_layout"         android:layout_width="match_parent"         android:layout_height="0dp"         android:layout_weight="1" >         <androidx.constraintlayout.widget.ConstraintLayout             android:id="@+id/linearLayout"             android:layout_width="match_parent"             android:layout_height="500dp"             android:layout_marginTop="100dp"             android:background="@color/cfb"             tools:context=".MainActivity">             <TextView                 android:id="@+id/TitleText2"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="@string/title2"                 android:textColor="#000000"                 android:textSize="30sp"                 android:textStyle="bold"                 android:layout_marginBottom="10dp"                 app:layout_constraintBottom_toTopOf="@+id/viewPager2"                 app:layout_constraintEnd_toEndOf="parent"                 app:layout_constraintStart_toStartOf="parent" />             <ImageButton                 android:id="@+id/refreshButton"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginStart="30dp"                 android:layout_marginLeft="30dp"                 android:layout_marginBottom="20dp"                 android:background="@color/cfb"                 app:layout_constraintBottom_toTopOf="@+id/viewPager2"                 app:layout_constraintStart_toEndOf="@+id/TitleText2"                 app:srcCompat="@drawable/refresh_111075__2_" />             <TextView                 android:id="@+id/refreshText"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:text="@string/refresh"                 android:textColor="#000000"                 android:textSize="18sp"                 android:layout_marginStart="20dp"                 android:layout_marginLeft="20dp"                 app:layout_constraintStart_toEndOf="@+id/TitleText2"/>             <ImageButton                 android:id="@+id/filterButton"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginTop="0dp"                 android:layout_marginBottom="10dp"                 android:layout_marginEnd="15dp"                 android:layout_marginRight="28dp"                 android:background="@color/cfb"                 app:layout_constraintEnd_toEndOf="parent"                 app:layout_constraintBottom_toTopOf="@+id/dots_indicator"                 app:srcCompat="@drawable/filter"                  />             <TextView                 android:id="@+id/filterText"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginEnd="25dp"                 android:layout_marginRight="40dp"                 android:text="@string/filter"                 android:textColor="#000000"                 app:layout_constraintEnd_toEndOf="parent"                 app:layout_constraintTop_toBottomOf="@+id/filterButton" />             <androidx.viewpager2.widget.ViewPager2                 android:id="@+id/viewPager2"                 android:layout_width="270dp"                 android:layout_height="270dp"                 android:layout_marginBottom="130dp"                 android:orientation="horizontal"                 app:layout_constraintBottom_toBottomOf="parent"                 app:layout_constraintEnd_toEndOf="parent"                 app:layout_constraintHorizontal_bias="0.5"                 app:layout_constraintStart_toStartOf="parent"                 app:layout_constraintVertical_bias="0.3" />             <com.tbuonomo.viewpagerdotsindicator.DotsIndicator                 android:id="@+id/dots_indicator"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginTop="110dp"                 app:dotsColor="@color/white"                 app:dotsCornerRadius="8dp"                 app:dotsSize="14dp"                 app:dotsSpacing="4dp"                 app:dotsWidthFactor="2.5"                 app:layout_constraintEnd_toEndOf="parent"                 app:layout_constraintHorizontal_bias="0.498"                 app:layout_constraintStart_toStartOf="parent"                 app:layout_constraintTop_toBottomOf="@id/viewPager2"                 app:layout_constraintBottom_toBottomOf="parent"                 app:progressMode="true"                 app:selectedDotColor="@color/black" />             <ImageView                 android:layout_width="90dp"                 android:layout_height="90dp"                 android:layout_marginStart="10dp"                 android:layout_marginLeft="10dp"                 android:layout_marginTop="70dp"                 android:clickable="true"                 app:srcCompat="@drawable/cafebot" />         </androidx.constraintlayout.widget.ConstraintLayout>         <androidx.constraintlayout.widget.ConstraintLayout             android:layout_width="match_parent"             android:layout_height="match_parent"             tools:context=".MainActivity">             <FrameLayout                 android:id="@+id/frameLayout"                 android:layout_width="match_parent"                 android:layout_height="0dp"                 app:layout_constraintBottom_toTopOf="@id/navigationView"                 app:layout_constraintLeft_toLeftOf="parent"                 app:layout_constraintRight_toRightOf="parent"                 app:layout_constraintTop_toTopOf="parent"/>             <com.google.android.material.bottomnavigation.BottomNavigationView                 android:id="@+id/navigationView"                 android:layout_width="match_parent"                 android:layout_height="wrap_content"                 android:background="?android:attr/windowBackground"                 app:layout_constraintBottom_toBottomOf="parent"                 app:layout_constraintLeft_toLeftOf="parent"                 app:layout_constraintRight_toLeftOf="parent"                 app:menu="@menu/bottom_nav" />         </androidx.constraintlayout.widget.ConstraintLayout>     </FrameLayout> </LinearLayout> </androidx.drawerlayout.widget.DrawerLayout>  
725
0
zzrkdldlazzrkdldla· 4년

질문spring (egov) safari 파일다운 질문드립니다 ㅠㅠ 도와주세요

전자정부로 웹 개발을 하던중 프로그램 다운 로직을 만들어서 hwp다운을 구현하였습니다 ios와 안드로이드로 테스트를 해보니 안드로이드는 정상적으로 다운로드가 되고 ios 는 파일이 깨저서 html 로 다운 받아지는 현상이 되고 있어서 도움을 구하고자 글을 올립니다! 먼저 userAgent 로 os를 확인해서 iphone ipad 일 경우 XMLHttpRequest(); download.js이용하여 다운로드를 하고 ipad iphone 가 아닐경우 엘스로 이동하여 안드로이드에서 다운이 되게끔 해두었는데 안드로이드에서는 작동이 잘 되나 아이폰 아이패드로 테스트 할 경우  alert(22)먼저 타게되고 1번을 타게 됩니다 그리고나서  개발자모드로 보면 이렇게 오류가 뜨고 있습니다 무엇이 문제 일까요?
1.9K
1
0
sonaki84
sonaki84·2021-03-30
개발자 모드를 보시면 아래와 같이 404 에러가 보인다고 하셨는데요. HTTP 상태코드 404는 URL 경로가 존재하지 않는 경우에 발생합니다. 즉, http://210.179.59.151/mIoT/mIoT/mobileIdvInfoDtl.do 라는 경로가 존재하지 않기 때문에 비정상적인 결과로 넘어오는 것은 아닌지 확인할...
dkncdknc· 4년

질문자바 알고리즘 질문

책으로 공부를하고있는데 답이랑 코딩이 없는책이라 어려움을 느끼고 있습니다. 1번 각각 정렬되어있는 두개의 단순연결리스트를 하나의 정렬된 단순연결 리스트로 만드는 메소드를 작성하시오. 각 노드에는 한개의 정수가 저장되어있다. 문제의 예  정렬된 a 는 1 4 6 정렬된 b 는 2 3 5 8 9 이렇게 있는데 단순연결리스트로 코드를 어떻게 작성해야할까요?   2번 각 노드에 한개의 정수가 저장된 단순연결리스트와 정수 k가 주어질때, 이 단순연결리스트를 하나는 k와 같거나 작은 정수를 가진 연결리스트로, 다른 하나는 k보다 큰 정수를 가진 노드들로만 구성되는 연결리스트를 분리하는 메소드를 작성하시오. 예를들어서 k = 7 이고 a는 8 ,9 b는 2,7,4,6 이거를 k보다 큰거를 표시하고 작은거를 표시하는 코드를 작성하고싶습니다.   
1.6K
1
0
무린
무린·2021-03-21
올리신 질문의 파이썬 정답이 있는 주소입니다. https://antananarivo.tistory.com/8   자바 버전으로 변환하려면 Node 클래스와 List 인터페이스가 필요한데 자바용 Node 클래스와 List 인터페이스를 만드는 방법은 이 링크를 참고해보시기 바랍니다. https://st-lab.tistory.com/167
무린무린· 4년

왜 자바 서버 개발자들은 코틀린을 채택하지 않는가

Why are Java server-side developers not adopting Kotlin? The Java server-side community hasn’t adopted Kotlin heavily yet, and the resistance doesn’t always arise from actual language merits. medium.com 오랜 자바 개발자로서 수년간 코틀린을 사용하고 그것을 서버에 적용해보면서 코틀린에 재미를 느낀 개발자가 쓴 글인데요 자바 서버 개발자들이 코틀린으로 서버 개발을 하지 않는 이유에 대해 본인의 관점에서 정리한 글입니다. 다시 말해 코틀린을 서버에 적용해도 좋다는 입장에서 항목별로 정리한 글 같습니다. 그 내용을 요약해 보았습니다. (물론 블로그의 내용일 뿐 제 의견은 아닙니다^^) --------------------------------------   "새로운 언어를 배울 시간이 없다" 새로운 학습의 시간이 필요하긴 하지만 좋은 소프트웨어는 시간 투자가 필요하며 숙련된 자바 개발자는 금방 학습할 수 있다.   "자바는 릴리즈할 때마다 좋아지고 있다" 자바도 릴리즈할 때마다 좋아지고 있는 것은 사실이지만 생산성에는 코틀린에 뒤쳐지고 있다   "자바 개발자인 것이 행복하다" 프로그래머는 하나의 언어에만 머무르는 것은 좋지 않다. 자바 개발자는 코틀린을 사용함으로써 뒤쳐지지 않을 수 있다.   "코틀린은 미래를 알 수 없는 언어이다" 2017년부터 나왔던 이슈이지만 구글은 그 해 안드로이드에 코틀린을 채택했다. Spring과 Micronaut같은 인기 프레임워크에서도 점점 수용하고 있다.   "이클립스를 사용하고 있는데 InteliJ로 전환하고 싶지 않다" 이클립스의 코틀린 환경이 JetBrains IDEA와 일치하지 않을 수 있다. JetBrains의 비지니스 모델에는 개발자 도구 판매도 있어서 쉽게 바뀔 것 같지 않긴 하다. 코틀린이 이클립스를 지원할 수 밖에 없는 상황이 오는 것도 좋긴 하지만 InteliJ가 자바 개발 용도로만 볼 때 더 나은 IDE이므로 전향하는 것도 나쁘지 않다.   "코틀린 개발자는 너무 비싸고 구하기 어렵다" 코틀린 개발자가 자바 개발자보다는 약간 비싼 것 처럼 보이기는 하다. 팀에서 코틀린을 우선으로 두는 것 자체가 채용 시 자바 개발자들이 새로운 것을 배울 수 있는 기회로 보일 수도 있다.   "코틀린은 너무 복잡하다" 코틀린은 사용성과 고급 기능 사이에서 균형을 유지하는 것이 목적인 언어이다. 코틀린을 자바 언어처럼 사용하려고하면 어려워질 수 있다.   "하나의 코드베이스에서 두 가지 언어를 사용하는 것은 혼란스럽다" 두 언어가 공존하는 것을 애초부터 염두해 두면 그렇게 혼란스럽지 않다. 자바가 남아있다고 코드가 안 돌아가는 것은 아니므로 코틀린을 우선으로 해서 바꿔가면 된다.   "우리는 자바가 더 편하다" 보통은 시간 부족으로 꺼리게 된다. 직무와 연관시키는 학습법을 통해 이 문제를 해결할 수 있다.   "코틀린이 가져오는 이점을 모르겠다" 몇몇 자바 개발자들은 코틀린을 시도하기 전에 시도하지 않을 이유부터 찾곤 한다.   결론적으로, 변화에 대한 저항은 있을 수 있지만 더 많은 자바 개발자들이 기회가 있을 때 코틀린을 접해보길 바란다. -------------------------------  
6.1K
1
1
0
닥터핸
닥터핸·2021-03-08
코틀린을 다시 보게 되네요
FaRaRoFaRaRo· 4년

질문Java JDK 버전과 JVM 버전 궁합? 관계 질문

현재 프로젝트를 다른 업체와 같이 하고 있습니다. Spring Boot 에서 개발을 하고 있구요. 환경 설정을 하는데 다른 업체에서 말하기를  자기 회사에서는 환경 설정을 0. 개발 및 빌드 : 윈도우 + Oracle JDK 1.8로 빌드를 하고 0. 실운영 서버는 : Linux Ubuntu 18.04 + Open JDK 11 + Tomcat 이렇게 한다고 하더군요. 빌드하는 버전과 JVM의 버전이 맞지 않는 것 같아서 버전을 서로 맞추는 것이 좋지 않겠냐고 말을 해 봤더니 이렇 하는 방식이 보편적이라는 말을 했습니다. 현재 이 업체는 다른 프로젝트들에서도 개발은 Oracle 1.8 JDK 를 많이 쓰고 있어서 굳이 버전 업을 하고 싶지 않은 것 같습니다.(그리고 무료로 오라클 JDK 버전을 쓸 수 있는 마지막 버전이 1.8 이라는 말도 하더군요)   질문: 제가 궁금한 것은 오라클 1.8 버전으로 빌드한 스프링 부트를 JVM 11 로 돌리는 게 어떤 이점이 있는 지 입니다. 저의 생각으로는 버전은 가능한 맞춰서 쓰는 게 좋을 것 같은데요... 제가 자바쪽 개발 경력이 많지 않아서 혹시 아시는 분이 있나 해서 물어봅니다.    
2.4K
2
0
kimho
kimho·2021-01-22
버전을 올림으로써 더 나아질 수도 있고 올림으로써 더 문제가 발생할 수도 있는 상황에서 결국은 어떤 것이 더 중요하느냐를 놓고 선택해야하는 이슈인 것 같습니다.   버전을 바꾼다는 것은 단지 호환성의 문제 뿐만이 아니라 생산성이나 비용의 문제도 같이 감안해야 하는 것 같습니다. 아무리 버전을 맞추는 것이 좋을 것 같다고 해도 그로 인해 발생...
DEBTOLEEDEBTOLEE· 5년

질문goorm 스프링부트 gradle WEB_002dINF 오류 해결이 안됩니다

goorm IDE 환경에서 공부하고 있는데요 JAVA에서 데이터를 jsp로 넘기려고 ModelAndView를 사용하는데 jsp에 데이터를 받는 ${name} 부분이 있으면 WEB_002dINF 오류가 발생합니다.  maven 해결방법은 많이 있는데 gradle로 해서 어떻게 해야할지를 모르겠어서 글을 적게 되었습니다 error message   gradle bootRun https://restapi-windz.run.goorm.io W 2020-07-02 01:38:49.998 ERROR 1276 --- [nio-8080-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exce ption [java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.boardList_jsp] with root cause java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.views.boardList_jsp at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_111]     java @RequestMapping(value="/boardList") public ModelAndView boardList( ){ ModelAndView mv = new ModelAndView(); mv.addObject("name","홍길동"); mv.setViewName("/boardList"); return mv; //return new ModelAndView("boardWrite"); } jsp   게시글 리스트 번호   제목   작성자   작성일   ${name} build.gradle   group 'io.goorm' version '0.0.1' apply plugin: 'java' sourceCompatibility = 1.8 buildscript{ //전역변수 선언 ext{ springBootVersion = '2.1.7.RELEASE' } repositories{ maven{ url "https://plugins.gradle.org/m2/" } mavenCentral() jcenter() } dependencies{ classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}" } } apply plugin: 'java' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { jcenter() mavenCentral() } dependencies { compile 'org.springframework.boot:spring-boot-starter' compile 'org.springframework.boot:spring-boot-starter-web' compile 'org.springframework.boot:spring-boot-starter-hateoas' compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.5.0' compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.5.0' testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile group: 'junit', name: 'junit', version: '4.12' // 데이터베이스연동 compile 'org.slf4j:slf4j-api:1.7.7' compile group: 'org.hsqldb', name:'hsqldb', version:'2.3.2' compile "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}" compile group: 'org.hibernate', name:'hibernate-validator', version:'5.1.3.Final' compile 'mysql:mysql-connector-java' //웹기반 디바이스에서 데이터 연동 compile group: 'javax.el', name:'javax.el-api',version:'3.0.0' compile group: 'javax.validation',name:'validation-api',version:'1.1.0.Final' compile 'javax.servlet:jstl' compile 'org.apache.tomcat.embed:tomcat-embed-jasper' compile group:'org.glassfish.web',name:'el-impl',version:'2.2' compile 'javax.inject:javax.inject:1' compile "com.google.dagger:dagger:2.8" annotationProcessor "com.google.dagger:dagger-compiler:2.8" } def webappDir = '$rootDir/src/main/webapp' jar { manifest { attributes 'Main-Class': 'project.Main' } }  
3.5K
2
0
kimho
kimho·2020-07-02
dependencies에 아래와 같이 servlet-api 추가가 필요할 것 같습니다. providedCompile 'javax.servlet:servlet-api:3.1.0'  
사용자 프로필· 5년

질문백엔드 개발자를 꿈꾸는 비전공자입니다. 처음 시작으로 자바 VS 파이썬 뭐가 좋을까요?

안녕하세요. 백엔드 개발자를 꿈꾸는 비전공 대학생입니다. 전공은 기계입니다. 이번에 부트캠프를 다녀볼까 고민중인데요. JAVA를 위주로 가르치는 곳(패xxxxx)이 있고, Python을 위주로 가르치는 곳(위xx)이 있더라구요. 유튜브도 보고, 검색도 해보고 여기저기 알아보니 python이 요즘 세계적으로 굉장히 핫하다고 하는데, 한국 기업들은 대부분 JAVA를 사용한다고 하더라구요. (채용글도 여러개 봤습니다) 어떤 걸 배워야할지(어느 곳을 다녀야 할지) 굉장히 고민되는데요. 고수님들 의견 주시면 감사하겠습니다.
1.2K
0
강구강구· 6년

질문Inner Interface 혹은 Interface안에 InnerClass

public abstract interface IA extends superAbc{     public static final int aa = 1;     public void asd();          interface IB{         public void test();     }          class CA{         public void a1(){                      }     }          abstract class CB{         public abstract void a23();     } }   질문 1. 위처럼 interface를 abstract으로 선언할 수 있나요? 일단 이클립스 상에서 문법오류는 나지 않습니다. 다만 interface를 abstract로 선언할 필요성이 있는지 궁금 합니다.   2.interface안에 inner Interface를 구현하는 경우가 있을까요? 만약 있다면 예를들어 어떤식으로 사용할 수 있나요?   3.interface안에 inner Class를 구현하는 경우가 있을까요? 만약 있다면 예를들어 어떤식으로 사용할 수 있나요?   4.interface안에 abstract inner class를 구현하는 경우가 있을까요? 만약 있다면 예를들어 어떤식으로 사용할 수 있나요?   위처럼 구현되는 경우를 본적이 없으나 문법상 오류가 없어 사용이 되는 경우도 있을거 같은데 어떤식으로 사용이 가능한지 알고 싶습니다.
1.6K
1
0
kimho
kimho·2019-04-04
추상클래스가 인터페이스를 implements하여 사용할 수는 있겠습니다만, 인터페이스가 추상클래스를 extends하는 것은 불가능하거나 된다해도 의미가 없을 것 같습니다.   추상클래스의 목적은 공통으로 사용할 구현체 클래스를 만드는 것입니다. 예를 들면 '학생'이라는 추상클래스를 만들어 놓고 이것을 이용하여 '...

질문실시간 이벤트 처리 방법(Esper 사용법)

java 에서 실시간으로 데이터를 입력하는 내용을 만들기 위해 알아보았습니다만... 방법을 잘 몰라서 ; 질문을 드리고자 합니다.   1.실시간 이벤트를 사용 하는 방법은 spark streaming, Esper 이 있는 것으로 알고 있는데요. 이 이외에 다른 쉬운 방법이 있나요? 2.Esper 에서 실시간 이벤트 사용 방법을 모르겠습니다. 본 사이트 : http://www.espertech.com/  설명서 : http://www.espertech.com/esper/esper-documentation/  설명 사이트 http://www.notforme.kr/archives/579  http://javacan.tistory.com/entry/Esper-Beginner-1-Quick-Start  http://sungsoo.github.io/2014/01/02/overview-of-esper.html  gitHub 적용 사이트 https://github.com/not-for-me/EsperStudyProject  https://github.com/espertechinc/esper  EPL 실험 해볼 수 있는 사이트 http://esper-epl-tryout.appspot.com/epltryout/mainform.html  를 참조해서 만들어 보았습니다. public void EesperExample2(UserInfoDto udto) { Configuration config = new Configuration(); config.addEventType("SearchYoutubeVo", SearchYoutubeVo.class.getName()); EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider(config);   String epl = "select * , count(*) from SearchYoutubeVo.win:time(5 minutes)"; List<SearchYoutubeVo> vo; EPStatement statement = epService.getEPAdministrator().createEPL(epl); ExampleListener example = new ExampleListener(); statement.addListener(example); int EventCreateNum = 5;   //for(int i = 0; i < EventCreateNum; i++ ){ try { vo = youtubeSearchService.searchYoutube(udto); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } //} }   public class ExampleListener implements UpdateListener { public void update(EventBean[] newEvents, EventBean[] oldEvents) { EventBean event = newEvents[0]; System.out.println("Avg Rating of NFM = " + event.get("viewCount") + " Total Count: " + event.get("videoId")); System.out.println(event.get("count(*)")); } } &#39;vo = youtubeSearchService.searchYoutube(udto);&#39; 는  youtube 키워드를 입력해서 이를 가지고오는 내용입니다. &#39;UserInfoDto udto&#39; 유저의 관련된 정보를 가지고 오는 것입니다. 그런데 제가 하고 싶은 것은 처음에  youtubeSearchService.searchYoutube(udto); 사용해서 데이터를 가조고온 후, 5분 간격으로 데이터를 가지고 오고 싶은 것인데.... 방법을 전혀 모르겠습니다.   그런데 ExampleListener  는 전혀 실행되지 않고 있습니다.
1.6K
1
1
0
쵸파
쵸파·2019-01-16
굿