노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

 

표준 프레임워크 개발 환경 구성: 원문링크1, 참조링크1

1. Eclipse설치: Download 64bit

2. Eclipse설치가 되면, Spring Core IDE설치:  dist.springframework.org/release/IDE

3. Eclipse설치가 되면, eGovFramework, 표준 프레임워크 설치

1) 3.8 : maven.egovframe.kr:8080/update_3.8

2) 3.5.1 : maven.egovframe.kr:8080/update

*설치후에 Perspective추가

*필수, 추가 설치: 참조링크

--JUnit(이클립스에 포함되어 설치됨)

--UML2 Extention

download.eclipse.org/releases/xxxxxxx,  Modeling->UML2 Extender SDK

--Subversive SVN Team Provider/ SVN Connector

: polarion download, Latest Stable Bulld for Eclipse

 

eGovFrame, New Web Project 만들기, 원문링크

-- Tomcat 8+, JDK 7+, Eclipse 2019-06, eGov 3.7 +, Spring Framework 4.2+, Maven 4.0+

-- 프로젝트 생성 에러: Java 버젼 및 Path 확인

--pom.xml 에러: Failed to read artifact xxxxx egovframework.rte xxxx 3.5.0

: 표준 프레임웍 레파지토리 주소 변경, 원문링크

: www.egovframe.go.kr/maven ==> maven.egovframe.kr:8080/maven/ 

 

-- web.xml Missing 에러 : src/main/webapp/WEB-INF/에 web.xml생성

 

# 기타, 실행 환경 Migration (3.5 -> 3.6)

 

egovframework:rtemigration3.6 [eGovFrame]

표준프레임워크 3.6는 기존 표준프레임워크 3.X와의 호환성을 염두해두고 실행환경의 버전 업그레이드를 진행하였으나, 전체 오픈소스SW 업그레이드에 따라 일부 변경이 필요합니다. 또한, 각 프로젝트의 상황 및 환경에 따라서 버전 업그레이드에 따른 충돌, 버그, 불안정성이 발생할 수도 있으니 충분한 테스트 후 진행하시기 바랍니다. 표준프레임워크 3.6는 JDK 1.7이 필요합니다. 이에 따라 우선 관련된 WAS 등 적용되어 있는 SW 등이 JDK 1.7을 지

www.egovframe.go.kr

 

# eGovFrame 버젼별 차이

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

# 이클립스에서 메이븐 프로젝트 만들기 ( Create a Meven Web Project with Eclipse)

 

 

>> 참조

# 이클립스에서 메이븐 참조 추가 (Import Maven Preferences in Eclipse)

-- 메이븐 원격 archetype 목록을 이클립스에서 import

 

>> 참조

* https://search.maven.org에서 검색 결과(June 2019)

# Web Application 프로젝트 개발 순서 (예제)

1.Create Maven Web Application

2.Add Dependencies - pom.xml File

3.Project Structure : Class Diagram

4.AppInitializer - Register a DispatcherServlet using Java-based Spring configuration

5.PersistenceJPAConfig - Spring and Hibernate Integration using Java-based Spring configuration

6.WebMvcConfig - Spring MVC Bean Configuration using Java-based Spring configuration

7.JPA Entity - Customer.java

8.Spring MVC Controller Class - CustomerController.java

9.Service Layer - CustomerService.java and CustomerServiceImpl.java

10.DAO Layer - CustomerDAO.java and CustomerDAOImpl.java 11 JSP Views - customer-form.jsp and list-customers.jsp

11.Serve Static Resources - CSS and JS

12.Build and Run an application

>> Class Diagram

-- AppInitializer, AppContext, WebMvcConfig

-- CustomerController, Customer

-- CustomerServiceImpl, CustomerService

-- CustomerDAOImpl, CustomerDAO

>> 참조

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

# 설정

1.그룹(채팅)을 개설하고,

2. LINE Notify를 그룹 멤버로 초대하고,

3. https://notify-bot.line.me에 로그인하고, MyPage에서 해당 그룹에 대한 Token을 발행

 

# 구현 예제, 코드

4. 프로그램 작성(Java) : https://github.com/sketchout/GroupNotifyLINE

 

# 참조

> 슬랙(Slack) 메신저로 메시지(알림) 보내기

https://blog.naver.com/macyoo/221388852982

 

'Web Tech. > Spring Framework' 카테고리의 다른 글

전자 정부 프레임웍, 설치 with MacBook  (0) 2019.08.08
Maven Project 생성하기  (0) 2019.06.28
thread-safe하도록 servlet작성하기  (0) 2018.07.20
Tomcat Memory Leak  (0) 2018.07.18
Java Spring + Slack Web Hook API  (0) 2018.03.13
블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

thread-safe하도록 servlet작성하기


만약 자바로 웹 어플리케이션을 작성한다면, 서블릿이 가장 친숙한다. JSP로 작성하거나 일반 서블릿으로 작성하든 관계 없이, 서블릿이 제공하는 장점을 받게 된다.

thread-safe라는 것은? 여러 thread가 프로그램의 단일 instance을 실행하여, 메모리를 공유할때, 동일한 위치(영역, 값)를 읽고 쓰려고 시도 할 수 있습니다.


자바 프로그램과 마찬가지로 서블릿은 JVM내에서 실행되어야 하지만, 웹 어플리케이션의 경우 서블릿 컨테이너가 HTTP요청이 들어 오는 곳에서 처리를 합니다.
서블릿의 생명주기의 상당 부분을 프로그래머가 제어 할 수 없고, 생성 및 파괴시에 메모리 사용에 대해 걱정하지 않는다. 
Google이나 Amazon처럼 많은 각 요청에 대해 서블릿은 인스턴스화를 하는 것은 실용적이지 않으며, 서블릿 컨테이너가 multi thread를 처리합니다.



1. thread-safe하냐?

변수 counter는 인스턴스 변수이고, 클래스내에서 정의되어, 클래스 인스턴스에 속합니다.
이 값은 method호출간에 유지되며, 문제는 서블릿 컨테이너가 multi thread이고, 다중 요청을 위해 서블릿의 단일 인스턴스를 공유한다는 점이다.

이 서블릿을 동시에 실행할때 어떤 일이 발생하는지 살펴보자. 처리에 지연을 위해 sleep()를 사용한다. HTML프레림을 사용하여 동시 요청을 만듭니다.

쓰레드 안전하지 않은 서블릿 코드는 다음과 같은 결과를 생성한다.

2.첫번째 방어 : 회피

각 쓰레드에 대해 고유한 변수 인스턴스를 갖도록하기 위해 클래스 내에서 변수 선언한 내용을 method내로 변수 선언을 이동하기만 하면 된다. 차이점은 method에 대한 각 호출에 대해 새 변수가 만들어진다.

3.두번째 방어: 부분 동기화

쓰레드 동기화는 알아야 할 중요한 기술이지만, 필요하지 않으면 이걸 솔루션으로 채택하지 마세요. 코드 블록을 동기화 할때마다 시스템에 병목 현상이 발생합니다. 코드 블록을 동기화할때, 주어진 순간에 동기화된 코드 블록내에 하나의 스레드만 있을 수 있다고 JVM 알려줍니다. 다중 쓰레드에서 동기화된 코드 블록으로 스레드가 실행되면, 2번째 스레드는 1번쨰 스레드가 해당 블록을 종료할때까지 대기해야 합니다.

4.마지막 방어: 전체 동기화

서블릿 컨테이너에 쓰레드가 안전하지 않다는 것을 알려주기 위해서, 빈 인터페이스를 구현해야 합니다. 구현하려는 tag는 SingleThreadModel인터페이스 입니다. 인터페이스를 적용하면, 2개의 쓰레드가 동시에 실행 될 수 없음을 보장 합니다. (블록이 발생하므로, 되도록 사용하면 안되겠죠?)

원문 : Jul 12, 2004
https://www.javaworld.com/article/2072798/java-web-development/write-thread-safe-servlets.html?page=2 

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

Tomcat Memory Leak

VisualVM을 사용해서, 메모리 누수를 찾기 위해, Tomcat 연결 하기


1. VisaulVM 다운로드

> Download 주소 : https://visualvm.github.io/download.html

> Monitor : CPU, Heap/Metaspace, Classes, Threads

> Plugin Download: https://visualvm.github.io/plugins.html


2. Tomcat setenv.sh 설정하기

위치 : ~tomcat/bin

#!/bin/sh

export CATALINA_OPTS="$CATALINA_OPTS

 -Dcom.sun.management.jmxremote.authenticate=false"

export CATALINA_OPTS="$CATALINA_OPTS

 -Dcom.sun.management.jmxremote.port=9999"

export CATALINA_OPTS="$CATALINA_OPTS

 -Dcom.sun.management.jmxremote.ssl=false"

export CATALINA_OPTS="$CATALINA_OPTS 

-Djava.rmi.server.hostname=localhost"


3. Tomcat 재시작


4. 연결하기 : ViusalVM - Remote - Add Host - Add Jmx Connection

* localhost가 서버인 경우에는 IP와 hostname를 매칭을 해 주세요. 

(/etc/hosts에 등록을 해도 됩니다.)


5. Heap Dump 

- 원격 Dump는 8-900M를 압축해서 다운로드

- Eclipse에서 Memory Analyzer(http://www.eclipse.org/mat/) 열기를 수행하면,
leak problem suspect를 접근 가능


> 원문 : java.lang.OutOfMemoryError: Metaspace

Tomcat는 1.25GB를 넘게 설정된 MaxMetaspaceSize지만,....
remote JMX 연결을 허용해서, VisualVM을 통해, metaspace를 살펴본다

https://apollogic.com/en/2017/05/fixing-memory-leaks-tomcat/


> 참조 : Metaspace란?

Java 7의 PermGen(Permanent Generation) Java 8에서는 사라지고, Metaspace라는 네이티브 메모리 영역으로 클래스 메타데이터들이 모두 이동했다...
heap영역에서 사용할 수 있는 메모리가 늘어났다...

http://starplatina.tistory.com/entry/JDK8%EC%97%90%EC%84%A0-PermGen%EC%9D%B4-%EC%99%84%EC%A0%84%ED%9E%88-%EC%82%AC%EB%9D%BC%EC%A7%80%EA%B3%A0-Metaspace%EA%B0%80-%EC%9D%B4%EB%A5%BC-%EB%8C%80%EC%8B%A0-%ED%95%A8

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

Java Spring + Slack Web Hook API



슬랙으로 메시지를 보내기



1. 슬랙에서 채널을 생성


2. 원하는 채널을 선택하고, 접근API를 생성


- 메뉴 : https://my.slack.com/services/new/incoming-webhook/

- 설명 : api.slack.com -> incoming webhooks




3. 연동(Java) 모듈 생성



  String hooksSlack = "https://hooks.slack.com/services/xx/yy/zz";


CloseableHttpClient client = HttpClients.createDefault();

HttpPost httpPost = new HttpPost(hooksSlack);


String message = " " ;

String json = "{ \"text\": \""+ message.toString() + "\" }";

StringEntity entity = new StringEntity(json);

httpPost.setEntity(entity);

httpPost.setHeader("Accept", "application/json");

httpPost.setHeader("Content-type", "application/json");

CloseableHttpResponse response = client.execute(httpPost);

log.error("getStatusCode : " + response.getStatusLine().getStatusCode() );

//assertThat( response.getStatusLine().getStatusCode(), equalTo(200) );

client.close();



- 실행 결과 (샘플)




# Spring Slack Integration


http://wooriworld2006.tistory.com/382



# POST with JSON


http://www.baeldung.com/httpclient-post-http-request



# Webhook URL 


https://stackoverflow.com/questions/37423129/slack-incoming-web-hook-and-getting-it-to-work-with-httppost

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


페이스북 Graph API 사용하기



페이스북 정보를 가져오기 ( 웹스크랩을 대체 )





홈 : http://restfb.com/ 



restfb


RestFB is a simple and flexible Facebook Graph API client written in Java.

It is open source software released under the terms of the MIT License.







깃허브 : https://github.com/restfb/restfb




초기화



함수 사용



- page.getLikesCount(), page.getNewLIkeCount() : Only Visible to a page admin.



* 엑세스 토큰과 앱 시크릿 : https://developers.facebook.com

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


Bash , Kill $pids




- 프로세스 찾기

- 문자열 null 비교

- Kill 명령어 실행


#!/bin/bash

lsof -i | grep 8117
pids=`lsof -i | grep 8117 | grep -v grep | awk '{print $2}'`
echo $pids
if [ ! -z "$pids" ] 
then
	kill -9 $pids
else
	echo "Not Found!"
fi


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

AWS S3 파일 업로드 연동하기 (with Java)


AWS S3와 연동하기 위해서는 아래 참조의 경우를 살펴보면, 장단점등이 있으며, 이를 보완할 필요가 있다. 

물론, 연동을 위해서는 Java용 AWS SDK가 필요하다.( aws.amazon.com/ko/sdk-for-java ) 



1. SDK를 포함후에 확인된 Dependency


- jackson-annotations-x.x.x.jar, jackson-core-x.x.x.jar, jackson-databind-x.x.x.jar

- joda-time-x.x.x.jar

- http-core-x.x.x.jar

- http-client-x.x.x.jar


실행시에 ClasssNotFoundException이 발생한다면, 해당 Dependency들을 추가 해야 한다.



2. 연동 클래스 만들기


1) 생성자부분


AmazonS3 amazonS3;


AWSCredentials creds = new BasicAWSCredentials(accessKey, secretKey);

amazonS3 = AmazonS3ClientBuild.standard()

.withCredential(creds)

.withRegions(Regions.XXX)

.withForceGlobalBucketAccessEnable(true)

.build();


* withRegions()이 없으면
: SdkClientException이 발생한다.(
Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region.)


http://docs.aws.amazon.com/ko_kr/general/latest/gr/rande.html

1) us-east-2 : 미국 동부 오하이오

2) us-east-1 : 미국 동부 버지니아 북부

3) us-west-1 : 미국 서부 캘리포니아 북부

4) us-west-2 : 미국 서부 오레곤

5) ap-south-1 : 아시아 태평양 뭄바이

6) ap-northeast-2 : 아시아 태평양 서울

7) ap-northeast-1 : 아시아 태평양 도쿄

8) ap-southeast-1 : 아시아 태평양 싱가프로

9) ap-southeast-2 : 아시아 태평양 시드니

... eu-central-1, eu-west-1, eu-west-2, sa-east-1, ca-central-1


2) File Upload부분


PutObjectRequest putObjectRequest = new PutObjectRequest(buckeName, fileName, file);


//file permission

putObjectRequest.setCannedAcl(CannedAccessControlList.PublicRead);


// fill upload

PutObjectResult ret = amazonS3.putObject(pubObjectRequest);





3) 소스 예제



참조 1, [Java] Java를 이용해 AWS S3 파일 업로드 하기

http://dwfox.tistory.com/57


- AmazonS3Client는 deprecated된 상태로 변경이 필요하다.



참조2, Amazon S3 Tutorial – The ULTIMATE Guide

https://www.javacodegeeks.com/2017/03/amazon-s3-tutorial.html


- AmazonS3ClientBuilder를 잘 설명하고 있으나, 다소 복잡한 면이 있다.


참조3, Working with AWS Credentials

http://docs.aws.amazon.com/ko_kr/sdk-for-java/v1/developer-guide/credentials.html

- AWSCredentials인터페이스는 BasicAWSCredentials를 AWS access key와 secret key를 사용해서 생성한다. 이떄 환경설정등에서 가져 오는 방법과 명시적으로 지정하는 방법을 알 수 있다.


참조4, Amazon S3 Examples ( using AWS SDK for Java )

http://docs.aws.amazon.com/ko_kr/sdk-for-java/v1/developer-guide/examples-s3.html 


참조5, Amazon S3,  버킷 생성, 

https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/UG/BucketOperations.html 


Amazon S3에 저장한 모든 객체는 버킷에 존재합니다. 디렉토리로 파일 시스템 내 파일을 그룹화하듯 버킷으로 관련 객체를 그룹화할 수 있습니다. 버킷은 액세스 권한 및 버전 관리 상태 등의 속성을 지니며, 사용자는 버킷이 속할 리전을 원하는 대로 설정할 수 있습니다.


참조6, Amazon S3,  폴더 작업

https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/UG/FolderOperations.html

Amazon S3에서 버킷과 객체는 기본 리소스이며 객체가 버킷에 저장됩니다. Amazon S3에서는 일반적인 파일 시스템에서와 같이 계층이 없는 단순한 구조입니다. 하지만 간결한 구성을 위해 Amazon S3 콘솔에서는 객체를 그룹화하는 수단으로 폴더 개념을 지원합니다.


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

vaddin 뉴스 - Vaadin Board for Java is now available





Hello ???,

After releasing Vaadin Board with an HTML API in May, we received a ton of questions on when it will be available with a Java API for Vaadin Framework users. The answer is: NOW, as we are pleased to announce the release of Vaadin Board for Java


Vaadin Board can be used to create dashboards, intro screens, image galleries, or just to build application layouts, so that they will look great on different devices. Responsive behaviour comes built-in and it just works, no need to write any CSS. A total breeze for Java developers. Vaadin Board is commercially licensed and is included in the Pro and Prime subscriptions.

Go check it out right away and give it a spin!

Kind regards, 

Vaadin Team

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.

Tomcat에 SSL(HTTPS)추가 하기





1. 위치 

: $CATALINA_HOME/conf


2. 파일 

: server.xml 


3. 수정할 부분 



1) 원본


<!-- 

    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"

               maxThreads="150" scheme="https" secure="true"

               clientAuth="false" sslProtocol="TLS"/>

-->



2. 수정


  <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"

               maxThreads="150" scheme="https" secure="true"

               clientAuth="false" sslProtocol="TLS"

keystorePass=""xxxx" keystoreFile="${user.home}/.keystore"/>



* keytool -genkey

"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
  -keystore \path\to\my\keystore



4. Servers에서 재등록시 SSL확인






원문

https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html


참조 

http://blog.daum.net/overpassion1/16


블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


Spring Boot , Thymeleaf 설정



1. 프로젝트 생성




- download , project import

* import후에 에러가 발생한다면, Maven Project 버젼을 내려서 시도.


2. 모듈 작성


- src/main/java
-- com.example.HelloController.java
package com.example;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 
 * Controller maps HTTP Requests with view.
 * 
 */
@Controller
public class HelloController {

	@RequestMapping("/hello")
	public String hello(Model model, 
			@RequestParam(value="name",required=false, defaultValue="World") String name) {
		
		model.addAttribute("name", name);
		
		return "hello";
	}
}


- src/main/resources
-- templates/hello.html
<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8" />
	<title>Hello Thymeleaf!</title>
</head>
<body>
	<p th:text="'Hello '+ ${name} +'!'" />
</body>
</html>

* thymeleaf


-- extends SpringBootServletInitializer , configure()

package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

@SpringBootApplication
public class ThymeleafappApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		SpringApplication.run(ThymeleafappApplication.class, args);
	}
	
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(ThymeleafappApplication.class);
	}
}



-- Run As -> Spring Boot App



참조

http://coderscampus.com/ep01-spring-boot-rocks/

https://hellokoding.com/spring-boot-hello-world-example-with-thymeleaf/

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


2016년 Java 개발 Tool 및 기술 사용 분석


- 작성 시점 : 2016년 초 ~ 7월14일
- 자료 수집 : 질문 항목에 답변
- 자료 답변 : 2,040명

- 설문 문항들
1) 여전히 Eclipse는 최고의 IDE인가?
2) Gradle은 Maven를 따라 잡았나?
3) Git는 승리한건가?
4) Java EE의 개발속도의 장점 및 단점?
5) Java 8을 사용하나?
6) 재배포에 걸리는 시간?
7) APM솔루션은 어떤것을 사용하나?

- 답변자들의 경력

 경력 (년)

비율 (%)

 0-4

15 

 5-9

24 

 10-14

23 

 15-19

19 

 20-29

15 

 30-39

- 답변자들의 직업

 직업

비율(%) 

 Software Developer

54 

Management 

3 

Architect 

18 

Team Lead 

12 

Consultant 

4 

Developer Advocate 

3 

Director/VP/C-Level 

3 

other 


- 답변자들의 개발 분야

분야

비율 (%)

 Full stack web application

67

Backend code only 

18 

Desktop 

6 

Mobile 

3 

Libraries 

2 

Batch 

1

 Other



A. 주요 상용 서비스에 사용하는 자바 버젼은?


종류

비율 (%)

Java 8

62 

Java 7

28 

Java 6

 Other


B. 주요 많이 사용하는 Java EE 버젼은?


종류

비율 (%)

Java EE 7

31 

Java EE 6

17 

Java EE 8

We don't

42 



C. 사용하는 IDE는 ?


종류

비율 (%)

Intellij IDEA

46 

Eclipe

41 

NetBeans

10 

Other


D. 사용하는 Build Tool은 ?


종류

비율 (%)

Maven

68 

Gradle

16 

Ant

11 

Other



E. 사용하는 Application Server 사용은 ?


종류

Production (%)

Development (%)

Tomcat

42 

42 

Jetty

8 

16 

Wildfly

9 

10 

JBoss EAP

8 

 WebLogic

WehSphere 

Glassfish 


F. 사용하는 Database은 ?


종류

비율 (%)

Oracle DB

39 

MySQL

38 

PostgreSQL

29 

MongoDB

15 

 MS SQL

8 

Redist 

8 

DB2 

7 

Other 

 Cassandra

H2 

Couchbase 

Neo4j 





G. 개발에 소요되는 building과 redeploying 시간은 ?


Minutes / App Redeploy

비율 (%)

0 - 1

29 

2 - 5

41 

6 - 10

12 

11 - 30

12 

30 +




H. 사용하는 Web Framework은 ?


Web Framework

비율 (%)

Spring MVC

43 

Spring Boot

29 

JSF

19 

Vaadin

13 

GWT ( Google )

 Play 2

 Grails

4 

Struts 2 

4 

We don't 

17 

Other 

13 

Struts 1 

3 

Apache Wicket

Play 1




I. Continuous Integraion Server은 ?


CIS

비율 (%)

Jenkins

60 

We don't

16 

Bamboo

Teamcity

6 

Other

4 

Hudson

3 

TravisCI



J. 가장 자주 사용하는 VCS은 ?


VCS

비율 (%)

Git

68 

Subversion

23 

Other

4 

Mercurial

3 

CVS



원문 :

https://zeroturnaround.com/rebellabs/java-tools-and-technologies-landscape-2016/

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.


Vaadin Appication 만들기


1. 준비물

- Eclipse ( www.eclipse.org )

- Vaadin Plugin for Eclipse ( Eclipse Market Place )


2. 프로젝트 생성

- New -> Vaadin -> Vaddin 7 Project with Maven 


- Select a Maven archetype 

    : Single-module Application Project(vaadin-archetype-application)


- Artiface Id : 필요에 따라 수정

- 생성된 소스 확인

@Theme("mytheme")
public class MyUI extends UI {

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        final VerticalLayout layout = new VerticalLayout();
        
        final TextField name = new TextField();
        name.setCaption("Type your name here:");

        Button button = new Button("Click Me");
        button.addClickListener( e -> {
            layout.addComponent(new Label("Thanks " + name.getValue() 
                    + ", it works!"));
        });
        
        layout.addComponents(name, button);
        layout.setMargin(true);
        layout.setSpacing(true);
        
        setContent(layout);
    }

    @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
    @VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
    public static class MyUIServlet extends VaadinServlet {
    }
}


3. Add to Tomcat 8.0


4. Run / Open

* 참조  -자료 동영상

https://youtu.be/o93ofXBIkf8 , Creating a Project from an Archetype


Hello World 만들기 

- init() 함수를 수정


1) Label 추가 하기

    @Override
    protected void init(VaadinRequest vaadinRequest) {
    	Label label = new Label("Hello World!");
    	setContent(label);
    }

2) Button 추가 하기

(1) button 생성

    @Override
    protected void init(VaadinRequest vaadinRequest) {
    	Button button = new Button("Greet");
    	setContent(button);
    }

(2) button addClickListener() 추가

@Override protected void init(VaadinRequest vaadinRequest) {         Button button = new Button("Greet");         button.addClickListener( e->Notification.show("Hello World!") );         setContent(button);

}

(3) text field 입력 받기 , VerticalLayout추가 하기

@Override protected void init(VaadinRequest vaadinRequest) { TextField textField = new TextField("Name");         Button button = new Button("Greet");         button.addClickListener( e->Notification.show("Hi! " + textField.getValue()) ); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.addComponents(textField,button);         setContent(button); }


(4) verticalLayout.setMargin(true)


(5) verticalLayout.setSpacing(true)


(6) verticalLayout.setMargin(true), verticalLayout.setSpacing(true)


* 참조  -자료 동영상

https://youtu.be/9-qwPfpSHWc


Bandend 추가하기와 Grid안에 항목 나열하기


1. 사용될 소스 복사 하기

- CustomerStatus.java

- Customer.java

- CustomerService.java 


2. 소스 수정 하기


1) grid 추가 하기 ( 전체 Data 불러오기 )

    private CustomerService service = CustomerService.getInstance();  
    private Grid grid = new Grid();
	
    @Override
    protected void init(VaadinRequest vaadinRequest) {

    	
    	VerticalLayout verticalLayout = new VerticalLayout();
    	
    	
    	verticalLayout.addComponent( grid );
    	
    	List customers = service.findAll();
    	grid.setContainerDataSource( new BeanItemContainer<>(Customer.class, customers) );
    	
    	// kind of updating
    	updateList();
    	
    	verticalLayout.setMargin(true);		// around space
    	verticalLayout.setSpacing(true);	// inside layout space
    	
    	
    	setContent(verticalLayout);
    	
    }



2) 특정 column만 grid에 표현 오기

    private CustomerService service = CustomerService.getInstance();  
    private Grid grid = new Grid();
	
    @Override
    protected void init(VaadinRequest vaadinRequest) {

    	
    	VerticalLayout verticalLayout = new VerticalLayout();
    	
    	grid.setColumns("firstName","lastName","email"); // here you go
    	
    	verticalLayout.addComponent( grid );
    	
    	List customers = service.findAll();
    	grid.setContainerDataSource( new BeanItemContainer<>(Customer.class, customers) );
    	
    	// kind of updating
    	updateList();
    	
    	verticalLayout.setMargin(true);		// around space
    	verticalLayout.setSpacing(true);	// inside layout space
    	
    	
    	setContent(verticalLayout);
    	
    }

    private void updateList() {
    	List<Customer> customers = service.findAll();
    	grid.setContainerDataSource(new BeanItemContainer<>(Customer.class, customers));
    }


 

* 참조  -자료 동영상

https://youtu.be/0W0frepDKWI




블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,
노출되는 이미지가 불편하시겠지만 양해를 구합니다. 노출, 클릭등에 관한 자료로 활용 중입니다.




XSS ( Cross Site Scripting ) 제거 하기


- 문자열을 아래와 같은 변환을 통해서, 불필요한 script를 제거 한다. ( 때로는 escape된 문자열를 변환후에 제거하는 과정도 필요하다. )


1. HTML Sanitizer Project




1) 다운로드


(1) owasp-java-html-sanitizer.jar



(2) Dependency jar


- guava : lib/guava-libraries/guava.jar
- JSR305 : lib/jsr305/jsr305.jar


2)  코드 작성

// prepackaged policies
String untrustedHTML="<script>alert()</script>";
PolicyFactory policy = Sanitizers.FORMATTING.and(Sanitizers.LINKS);
String safeHTML = policy.sanitize(untrustedHTML);


2. Jsoup


1) 다운로드 jsoup-1.10.2.jar


2) 코드작성

String unsafe =   "<p><a onclick="stealCookies()" href="http://example.com/">Link</a></p>";
String safe = Jsoup.clean(unsafe, Whitelist.basic());
// now: <p><a href="http://example.com/" rel="nofollow">Link</a></p>


* UnescapeHtml() - Class StringEscapeUtils - commons.apache.org

Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes

블로그 이미지

StartGuide

I want to share the basic to programming of each category and how to solve the error. This basic instruction can be extended further. And I have been worked in southeast Asia more than 3 years. And I want to have the chance to work another country.

,