Java 설정 파일로 많이 쓰이는 Properties 사용법
String openProp = request.getRealPath("/taesuz/") + "/taesuz.properties";
try{
Properties props = new Properties();
props.load( new FileInputStream( openProp ));
props.setProperty("type", type );FileOutputStream fos = new FileOutputStream( openProp );
props.save(fos, "open type change");
out.println( "open type change: " + type );
} catch (IOException ioe){
out.println( ioe );
} catch (Exception e){
out.println( e );
}
댓글 없음:
댓글 쓰기