Object-Graph Navigation Language (OGNL)
자바가 아닌 곳에서 자바를 쓰고 싶을 때 쓰는 언어.
ex) xml에서 java 쓰기
쓰는 방법의 경우
https://commons.apache.org/proper/commons-ognl/language-guide.html
아파치 사이트에 잘 설명되어 있다.
메소드 부르는 방법
스태틱 메소드 부르는 방법 등
실제로 사용하기
member.xml 파일
혹은
<sql id="searchFrag"> <where> <if test="simpleSearch!=null and @org.apache.commons.lang3.StringUtils@isNotBlank(simpleSearch.searchWord)"> <choose> <when test="simpleSearch.searchType eq 'name'"> INSTR(MEM_NAME, #{simpleSearch.searchWord}) > 0 </when> <when test="simpleSearch.searchType eq 'address'"> INSTR(MEM_ADD1, #{simpleSearch.searchWord}) > 0 </when> <otherwise> INSTR(MEM_NAME, #{simpleSearch.searchWord}) > 0 OR INSTR(MEM_ADD1, #{simpleSearch.searchWord}) > 0 </otherwise> </choose> </if> </where> </sql> <select id="selectMemberList" resultType="memberVO" parameterType="PagingVO" > SELECT B.* FROM( SELECT A.*, ROWNUM RNUM FROM( SELECT ROWID RID, mem_id, mem_pass, mem_name, mem_mail , MEM_ADD1 FROM member <include refid="searchFrag" /> ORDER BY RID DESC ) A ) B <![CDATA[ WHERE RNUM >= #{startRow} AND RNUM <= #{endRow} ]]> </select>
이렇게 사용할 수도 있다.
Uploaded by Notion2Tistory v1.1.0