Category: Java

자바 개발 관련 카테고리입니다.

Java

[AES 256] crypto Cipher 사용하기

import java.security.InvalidAlgorithmParameterException;import java.security.InvalidKeyException;import java.security.NoSuchAlgorithmException;import java.security.spec.AlgorithmParameterSpec;import javax.crypto.BadPaddingException;import javax.crypto.Cipher;import javax.crypto.IllegalBlockSizeException;import javax.crypto.NoSuchPaddingException;import javax.crypto.spec.IvParameterSpec;import javax.crypto.spec.SecretKeySpec; public class AES256Cipher {      public static byte[] ivBytes = { 0x00, 0x00,...
Java

(iBATIS)아이바티스 IN절 사용법 (iterate 사용)

[Server side 코드] var idList = new List();  idList.Add(10); idList.Add(12); [아이바티스 내 사용법]    < select id=”GetLogin”  parameterClass=”cusstomParam” resultClass=”int” >       SELECT DISTINCT StudentName       FROM STUDENT       WHERE Year = #Year#       < isNotEmpty property=”AgencyYn” prepend=””>         < isEqual property=”AgencyYn” prepend=”AND” compareValue=”Y”>           < iterate prepend=”” property=”IDList” open=”AgencyID IN (” close=”)” conjunction=”,”>             #IDList[]#           < /iterate>         < /isEqual>       < /isNotEmpty>     < /select>
Java

(iBATIS)아이바티스 사용시 주의사항

$기호는 절대 쓰면 안된다. 왜냐하면 SQL인젝션이 가능해지기 때문이다. [잘못된 사용법]select distinct LibID from Student where student_name like ‘%$SearchText$%’ [올바른 사용법]select distinct LibID from Student where student_name like ‘%’ + #SearchText#+’%’   꺽쇠(<,>)기호 사용시 CDATA를 사용해야한다.select distinct LibID from Student where student_id <! [CDATA[ < ]] > 100
Java

Java에서 서블릿을 둘 이상의 URL 패턴에 매핑하도록 web.xml을 구성하는 방법 (No mapping found for HTTP request with URI 오류가 발생한다면?)

URL 패턴을 두가지 방향으로 처리해야하는 상황에 직면하였다. 현재는 .do URL만 접근 허용토록 하고 있다. [web.xml] <servlet> <servlet-name>action</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/springmvc/dispatcher-servlet.xml, </param-value>...
error: Content is protected !!