CREATE TABLE ADM_HISTORY ( SEQ NUMBER NOT NULL, USER_ID VARCHAR2(20) NOT NULL, CUD VARCHAR2(1) CHECK( CUD IN('C', 'U', 'D')) NOT NULL, TITLE VARCHAR2(2000) NOT NULL, URL VARCHAR2(500) NULL, REGDATE DATE DEFAULT SYSDATE, PRIMARY KEY ( SEQ ), FOREIGN KEY ( USER_ID ) REFERENCES ADM_USERS ( USER_ID ) );
분류 전체보기
- create table check in 2011.07.06
- 파이어폭스, 크롬등 비IE 에서 Flex javascript 호출(callback) 문제 해결 2011.06.13
- AES 암호화 예제(128Bit) 2011.06.09
- JEUS6 세션공유 설정, 중앙식세션서버 설정, SSO 2011.05.26
- WebToB 4.1 + JEUS 6 가상호스트, 컨텍스트 추가 2011.05.26
- WebToB 4.1 + JEUS 6 연동 2011.05.25
- JEUS 컨테이너 추가(포트 추가) 2011.05.24
- 도메인 다른 경우 IFrame Resize 2011.05.13
- java 압축 zip 만들기 2011.05.13
- 타 도메인간 P3P 허용하기 2011.05.11
create table check in
2011. 7. 6. 13:01
파이어폭스, 크롬등 비IE 에서 Flex javascript 호출(callback) 문제 해결
2011. 6. 13. 10:21
이 문제로 조금 삽질 좀 했군!!
<object id='" + id + "' ....
<embed name='" + id + "' ...</embed>
</object>
IE 일경우
document.getElementById("swf")
비 IE 일경우
window.document["swf"];
또한 Object 에는 ID값으로 Embed 에는 name 값으로 한다. 만약 Embed 에도 id 값으로 하게되면 정상적으로 obejct를 얻어오지 못한다.
<object id='" + id + "' ....
<embed name='" + id + "' ...</embed>
</object>
IE 일경우
document.getElementById("swf")
비 IE 일경우
window.document["swf"];
또한 Object 에는 ID값으로 Embed 에는 name 값으로 한다. 만약 Embed 에도 id 값으로 하게되면 정상적으로 obejct를 얻어오지 못한다.
AES 암호화 예제(128Bit)
2011. 6. 9. 10:45
public class CipherUtil { private Log LOG = LogFactory.getLog(this.getClass()); /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub CipherUtil cu = new CipherUtil(); Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssss"); String key = sdf.format(cal.getTime()); System.out.println("key: " + key); String text = "가나다라마바사@★아&자@12!@#$%"; String encryptText = null; String decryptText = null; try { encryptText = cu.encryptAES(text, key); decryptText = cu.decryptAES(encryptText, key); } catch (Exception e) { e.printStackTrace(); } System.out.println("encryptText: " + encryptText); System.out.println("beforeText : " + text); System.out.println("decryptText: " + decryptText); // 2011051813190051 // abcdefgh01234567 } // key는 16바이트로 구성 되어야 한다. private String encryptAES(String s, String key) throws Exception { String encrypted = null; try { SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); encrypted = byteArrayToHex(cipher.doFinal(s.getBytes())); return encrypted; } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error(e.getMessage(), e); } throw e; } } // key는 16 바이트로 구성 되어야 한다. private String decryptAES(String s, String key) throws Exception { String decrypted = null; try { SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, skeySpec); decrypted = new String(cipher.doFinal(hexToByteArray(s))); return decrypted; } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error(e.getMessage(), e); } throw e; } } private byte[] hexToByteArray(String s) { byte[] retValue = null; if (s != null && s.length() != 0) { retValue = new byte[s.length() / 2]; for (int i = 0; i < retValue.length; i++) { retValue[i] = (byte) Integer.parseInt(s.substring(2 * i, 2 * i + 2), 16); } } return retValue; } private String byteArrayToHex(byte buf[]) { StringBuffer strbuf = new StringBuffer(buf.length * 2); for (int i = 0; i < buf.length; i++) { if (((int) buf[i] & 0xff) < 0x10) { strbuf.append("0"); } strbuf.append(Long.toString((int) buf[i] & 0xff, 16)); } return strbuf.toString(); } }
[출처] 구글링
JEUS6 세션공유 설정, 중앙식세션서버 설정, SSO
2011. 5. 26. 17:36
물리적 서버 한대에 컨테이너를 여러개 띄웠을 경우
[JEUSMain.xml]
<node>
<name>ddakker-v</name>
.....
<session-server>
[JEUSMain.xml]
<node>
<name>ddakker-v</name>
.....
<session-server>
<type>primary</type>
<resolution>60000</resolution>
<connect-timeout>5000</connect-timeout>
<read-timeout>20000</read-timeout>
<passivation-to>-1</passivation-to>
<removal-to>1800000</removal-to>
<check-to>30000</check-to>
</session-server>
...
...
</node>
[WEBMain.xml] 컨테이너 엔진에 각각
<web-container>
....
[물리적 서버가 또 있을 경우]
[/JEUS6.0/config/vhost.properties]
DDAKKER-COM=백업서버IP:9736
[백업서버 설정]
[WEBMain.xml]
다른 파일과 동일하게 설정
[물리적 서버가 또 있을 경우]
[/JEUS6.0/config/vhost.properties]
ddakker-v=:primary서버IP9736
[제우스 웹 어드민]
http://localhost:9744/webadmin/app
[WEBMain.xml] 컨테이너 엔진에 각각
<web-container>
....
<session-config>
<distributable>true</distributable>
<shared>true</shared>
<timeout>30</timeout>
<reload-persistent>true</reload-persistent>
<session-cookie>
<domain>.test.co.kr</domain>
</session-cookie>
</session-config>
<session-server>
<primary-server>ddakker-v</primary-server>
<!-- <backup-server>DDAKKER-COM</backup-server> 백업서버 있을 경우(별도의 물리적 서버에 있을때) -->
<!-- <backup-server>DDAKKER-COM</backup-server> 백업서버 있을 경우(별도의 물리적 서버에 있을때) -->
</session-server>
...
</web-container> ...
[물리적 서버가 또 있을 경우]
[/JEUS6.0/config/vhost.properties]
DDAKKER-COM=백업서버IP:9736
[백업서버 설정]
[JEUSMain.xml]
<node>
<name>DDAKKER-COM</name>
.....
<session-server>
<node>
<name>DDAKKER-COM</name>
.....
<session-server>
<type>backup</type>
<resolution>30000</resolution>
<thread-pool>
<min>10</min>
<max>20</max>
</thread-pool>
<connect-timeout>180000</connect-timeout>
<read-timeout>60000</read-timeout>
<passivation-to>1000</passivation-to>
<removal-to>3600000</removal-to>
<file-db-path>/data1/wonchul/sessiondata</file-db-path>
<file-db-name>sessiondata</file-db-name>
<min-hole>2000</min-hole>
<packing-rate>0.8</packing-rate>
<check-to>20000</check-to>
<backup-trigger>500</backup-trigger>
<recovery-mode>active</recovery-mode>
<replicated-server>ddakker-v</replicated-server>
</session-server>
...
</node> [WEBMain.xml]
다른 파일과 동일하게 설정
[물리적 서버가 또 있을 경우]
[/JEUS6.0/config/vhost.properties]
ddakker-v=:primary서버IP9736
[제우스 웹 어드민]
http://localhost:9744/webadmin/app
WebToB 4.1 + JEUS 6 가상호스트, 컨텍스트 추가
2011. 5. 26. 11:37
WebToB 4.1 + JEUS 6 연동
2011. 5. 25. 13:52
[JEUSMain.xml]
<jeus-system xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="6.0">
<jeus-system xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="6.0">
<node>
<name>ddakker-v</name>
<class-ftp>true</class-ftp>
<sequential-start>true</sequential-start>
<enable-webadmin>true</enable-webadmin>
<engine-container>
<name>container1</name>
<command-option>-Xmx128m</command-option>
<sequential-start>true</sequential-start>
<engine-command>
<type>servlet</type>
<name>engine1</name>
</engine-command>
</engine-container>
</node>
<application>
<name>/</name> <!-- 그냥 Context 이름이다. 컨텍스트 설정은 자동으로 생성되는 WEB-INF/jeus-web-dd.xml 에서 설정한다. -->
<path>c:\webContent_a</path>
<deployment-target>
<target>
<engine-container-name>ddakker-v_container1</engine-container-name>
<web-context-group>
<name>MyGroup</name>
</web-context-group>
</target>
</deployment-target>
<deployment-type>COMPONENT</deployment-type>
<web-component/>
</application>
</jeus-system>
[WEBMain.xml]
[http.m]
컴파일 \> wscfl -i http.m
[jeus.properties.cmd]
[제우스 웹 어드민]
http://localhost:9744/webadmin/app
[참조]
http://eroicaplus.blog.me/90035788574
http://eroicaplus.blog.me/90035788551
http://kalpa730.blog.me/140115359356
[WEBMain.xml]
<web-container xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="6.0">
<context-group>
<group-name>MyGroup</group-name>
<webserver-connection>
<http-listener>
<listener-id>http1</listener-id>
<port>8088</port>
<thread-pool>
<min>10</min>
<max>20</max>
<step>1</step>
</thread-pool>
</http-listener>
<webtob-listener>
<listener-id>webtob1</listener-id>
<port>9900</port>
<output-buffer-size>8192</output-buffer-size>
<thread-pool>
<min>1</min>
<max>5</max>
<step>1</step>
<max-idle-time>30000</max-idle-time>
</thread-pool>
<webtob-address>localhost</webtob-address> <!-- WebToB 아이피 -->
<webtob-home>C:/TmaxSoft/WebtoB4.1</webtob-home>
<registration-id>MyGroup</registration-id>
</webtob-listener>
</webserver-connection>
</context-group>
</web-container>
[http.m]
*DOMAIN
webtob1
*NODE
ddakker-v WEBTOBDIR="C:/TmaxSoft/WebtoB4.1",
SHMKEY = 54000,
HOSTNAME = "a.test.co.kr",
DOCROOT="C:/webContent_a",
PORT = "8080",
HTH = 1,
NODENAME = "$(NODENAME)",
LOGGING = "log1",
ERRORLOG = "log2",
JSVPORT = 9900
*SVRGROUP
htmlg NODENAME = "ddakker-v", SVRTYPE = HTML
cgig NODENAME = "ddakker-v", SVRTYPE = CGI
ssig NODENAME = "ddakker-v", SVRTYPE = SSI
jsvg NODENAME = "ddakker-v", SVRTYPE = JSV
*SERVER
html SVGNAME = htmlg, MinProc = 2, MaxProc = 10
cgi SVGNAME = cgig, MinProc = 4, MaxProc = 10
ssi SVGNAME = ssig, MinProc = 2, MaxProc = 10
MyGroup SVGNAME = jsvg, MinProc = 25, MaxProc = 30
*URI
uri1 Uri = "/cgi-bin/", Svrtype = CGI
*ALIAS
alias1 URI = "/cgi-bin/", RealPath = "C:/TmaxSoft/WebtoB4.1/cgi-bin/"
*LOGGING
log1 Format = "DEFAULT", FileName = "C:/TmaxSoft/WebtoB4.1/log/access.log",
Option = "sync"
log2 Format = "ERROR", FileName = "C:/TmaxSoft/WebtoB4.1/log/error.log",
Option = "sync"
*EXT
htm MimeType = "text/html", SvrType = HTML
html MimeType = "text/html", SvrType = HTML
hwp MimeType = "application/x-hwp", SvrType = HTML
pdf MimeType = "application/x-pdf", SVRTYPE = HTML
css MimeType = "text/css", SvrType = HTML
js MimeType = "application/x-javascript", SvrType = HTML
jsp MimeType = "application/jsp", SvrType = JSV
jspf MimeType = "text/plain", SvrType = JSV
do MimeType = "application/servlet", SvrType = JSV
gul MimeType = "application/gul", SvrType = HTML
gif MimeType="image/gif", SvrType=HTML
jpeg MimeType="image/gif", SvrType=HTML
jpg MimeType="image/gif", SvrType=HTML
wmv MimeType="audio/video/x-ms-wmv", SvrType=JSV
zip MimeType="application/zip", SvrType=HTML
jar MimeType="application/x-java-archive", SvrType=HTML
exe MimeType="application/octet-stream", SvrType=HTML
swf MimeType="application/x-shockwave-flash", SvrType=HTML 컴파일 \> wscfl -i http.m
[jeus.properties.cmd]
rem set up JEUS_WSDIR
rem SET JEUS_WSDIR=%JEUS_HOME%\webserver -- 주석
[제우스 웹 어드민]
http://localhost:9744/webadmin/app
[참조]
http://eroicaplus.blog.me/90035788574
http://eroicaplus.blog.me/90035788551
http://kalpa730.blog.me/140115359356
JEUS 컨테이너 추가(포트 추가)
2011. 5. 24. 14:55
[JEUSMain.xml]
<engine-container>
<engine-container>
<name>container1</name>
<command-option>-Xms256m -Xmx512m -XX:MaxPermSize=128m</command-option>
<sequential-start>true</sequential-start>
<engine-command>
<type>servlet</type>
<name>engine1</name>
</engine-command>
</engine-container>
<engine-container>
<name>container2</name>
<command-option>-Xms256m -Xmx512m -XX:MaxPermSize=128m</command-option>
<sequential-start>true</sequential-start>
<engine-command>
<type>servlet</type>
<name>engine2</name>
</engine-command>
</engine-container>
..JEUS\config\컴이름_servlet_engine1 폴더를 engine2 로 복사하여 추가
[WEBMain.xml]
port 노드 포트 겹치지 않게 변경
web-context-group 의 name노드 MyGroup2 로 변경
<application>
<name>/</name>
<path>D:\ProjectSource\Study\TEST_Servlet</path>
<deployment-type>COMPONENT</deployment-type>
<web-component/>
<deployment-target>
<target>
<engine-container-name>DDAKKER-COM_container1</engine-container-name>
<web-context-group>
<name>MyGroup</name>
</web-context-group>
</target>
</deployment-target>
<deployment-type>EAR</deployment-type>
</application>
<application>
<name>/</name>
<path>D:\ProjectSource\Study\TEST_jQeury</path>
<deployment-type>COMPONENT</deployment-type>
<web-component/>
<deployment-target>
<target>
<engine-container-name>DDAKKER-COM_container2</engine-container-name>
<web-context-group>
<name>MyGroup2</name>
</web-context-group>
</target>
</deployment-target>
<deployment-type>EAR</deployment-type>
</application>
..JEUS\config\컴이름_servlet_engine1 폴더를 engine2 로 복사하여 추가
[WEBMain.xml]
port 노드 포트 겹치지 않게 변경
web-context-group 의 name노드 MyGroup2 로 변경
도메인 다른 경우 IFrame Resize
2011. 5. 13. 15:15
http://www.test.com/a.html
http://www.test.com/autoResize.html
http://www.test2.com/b.html
[참조] http://bluelenz.tistory.com/54
http://www.test.com/autoResize.html
http://www.test2.com/b.html
a
b
[참조] http://bluelenz.tistory.com/54
java 압축 zip 만들기
2011. 5. 13. 14:18
private boolean createZIP(List list, String strOutputFileName) { byte[] buffer = new byte[2048]; try { ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(strOutputFileName)); String strFileName = ""; for (int i=0; i<list.size(); i++){ strFileName = (String) list.get(i); strFileName = strFileName.substring(12); File f = new File(uploadPath + File.separator + strFileName); FileInputStream fin = new FileInputStream(f); ZipEntry ze = new ZipEntry(f.getName()); ze.setTime( f.lastModified() ); zout.putNextEntry(ze); int nlen = 0; while( (nlen = fin.read(buffer) ) > 0) { zout.write(buffer, 0, nlen); } zout.closeEntry(); fin.close(); } zout.close(); return true; } catch (IOException e) { e.printStackTrace(); return false; } }
타 도메인간 P3P 허용하기
2011. 5. 11. 10:23
JSP
response.addHeader("P3P","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")
ASP
Response.AddHeader "P3P", "CP=NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM PRE"
PHP
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
response.addHeader("P3P","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"")
ASP
Response.AddHeader "P3P", "CP=NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM PRE"
PHP
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');