블로그 이미지
헤이장

Notice

Recent Post

Recent Comment

Recent Trackback

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
  • total
  • today
  • yesterday
2009. 8. 14. 14:55 Web/JavaScript

<기본형태>
window.open(url, name, properties)

url : 띄울 페이지 주소
name : 창 이름
properties : 속성

<properties>

width=300 // 넓이(크기)
height=300 // 높이(크기)
left=300 // 왼쪽에서(위치)
top=300 // 위에서(위치)
menubar=1 // 메뉴바 없는
fullscreen // 전체화면
status=1 // 상태표시바 있는
scrollbars=1 // 스크롤바 있는
location=1 // 주소창 있는

   ex) window.open("window1.html", "", "width=300, height=300, scrollbars=1");

※ var win1 = window.open(url, name, properties);
win1 변수로 자식 창을 콘트롤 할 수 있다
win1.openwindow(); // win1 자식 창의 openwindow() 자바스크립트 함수 호출

'Web > JavaScript' 카테고리의 다른 글

TEXT 폼 엔터처리  (0) 2009.07.27
posted by 헤이장
2009. 7. 27. 20:38 Web/Jsp

EL 태그로 함수를 호출 하려면 어떻게 해야할까? 

1. 사용할 정적(static) 메서드를 만든다


GetPi.java


package elf;

public class GetPi {
    public static double getValue(Double plus) {
        return 3.14 + plus;
    }
}


 elf.tld

<?xml version="1.0" encoding="UTF-8"?>

<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">
    <tlib-version>1.0</tlib-version>
    <short-name>elf</short-name>
    <uri>elfunction</uri>
    <function>
        <name>pi</name>
        <function-class>elf.GetPi</function-class>
        <function-signature>
          double getValue(java.lang.Double)
        </function-signature>
    </function>
</taglib>


uri 는 태그 라이브러리에 등록하는 부분
name 은 JSP 에서 사용할 메서드 이름
function-class 는 실제 사용 클래스
function-signature 는 사용할 메서드 형태 (인자값 사용가능) 

3. JSP 에 taglib 지시자를 코딩한다
4. EL 에서 함수를 호출한다

elfTest.jsp


<
%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="elf" uri="elfunction"%>

<html>
    <body>
        <h1>PI + 6.55 = </h1>
        <h1>${elf:pi(6.55)}</h1>
    </body>
</html>

결과는

PI + 6.55 = 9.69

posted by 헤이장
2009. 7. 27. 20:31 Web/Jsp


더하기 +
빼기 -
곱하기 *
나누기 / div
나머지 % mod 

AND && and
OR || or
NOT ! not

등호 == eq
부등호 != ne
~보다 작다 < lt
~보다 크다 > gt
~보다 작거나 같다 <= le
~보다 크거나 같다 >= ge

 
예약어 

true -
false - 거짓
null -
instanceof
empty null 또는 비어있는지 체크하기 위한 연산자


posted by 헤이장
2009. 7. 27. 20:26 Web/Jsp

※ JSP 코드에서 자바소스를 사용할 수 없도록 하기

 DD 에서 설정 (web.xml)

<web-app>
 

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <scripting-invalid>true</scripting-invalid>
        </jsp-property-group>
    </jsp-config> 

</web-app>


EL 무시하게 하기

 DD 에서 설정 (web.xml)


<web-app>
 

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>true</el-ignored>
        </jsp-property-group>
    </jsp-config>

</web-app>


 JSP 페이지에서


<
%@page isELIgnored="true" %>


DD 에서 설정하면 모든 페이지에 적용이 되고
JSP 페이지에서의 선언이 DD 에서의 선언보다 우선시 된다

posted by 헤이장
2009. 7. 27. 20:21 Web/Framework


<select id="getCategory_No" resultClass="vo.Category">
        select * from category where no = #value#
</select>

<select id="getCategory_No" parameterClass="int" resultClass="vo.Category">
        select * from category where no = #value#
</select>

두가지 경우는 동일한 결과를 보인다
parameterClass 가 VO 객체일 경우에도 동일하다
실제로 ibatis 교재에는 parameterClass 로 xml 을 받는 경우를 제외하고 대부분 parameterClass 를 선언하지 않고 있다

※ parameterClass 에 선언을 하지 않으면 - 어떤 파라메터도 전달이 된다
※ parameterClass 에 선언을 하면 - 그 자료형이 아니면 SQL예외처리가 발생한다

 parameterClass 를 선언해 주는 것이 잘못된 자료형이 전달되는 것을 미리 막아주는 것 같다

posted by 헤이장