상세 컨텐츠

본문 제목

[DWR 사용법] 설정파일(dwr.xml) 등록하기

프로그래밍/JAVA

by 라제폰 2009. 9. 3. 19:48

본문


일반적으로 dwr 설정파일인 dwr.xml 파일은 {webapp}/WEB-INF/ 하위에 위치시키면 자동으로 인식을 하게 된다.

 

일반적으로 아래와 같이 설정을 하여 사용하면 된다.

 

//////////////////////////////////////// dwr.xml /////////////////////////////////////////////////

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 0.4//EN" "http://www.getahead.ltd.uk/dwr/dwr.dtd">

 

<dwr>


    <allow>

        <!-- Spring에서 정의된 Class 호출 -->
        <create creator="spring" javascript="userService">
            <param name="beanName" value="userService" />
            <include method="insertUserDWR" />
            <include method="updateUserDWR" />
        </create>

 

        <!-- 일반적인 Bean Class 호출 -->
        <create creator="new" javascript="BranchDLL" scope="request">
            <param name="class" value="pfm.dll.BranchDLL"/>
            <include method="method1" />
            <include method="method2" />
        </create>

 

        <converter id="null"       class="uk.ltd.getahead.dwr.convert.NullConverter"/>
        <converter id="primitive"  class="uk.ltd.getahead.dwr.convert.PrimitiveConverter"/>
        <converter id="string"     class="uk.ltd.getahead.dwr.convert.StringConverter"/>
        <converter id="array"      class="uk.ltd.getahead.dwr.convert.ArrayConverter"/>
        <converter id="map"        class="uk.ltd.getahead.dwr.convert.MapConverter"/>
        <converter id="collection" class="uk.ltd.getahead.dwr.convert.CollectionConverter"/>
        <converter id="date"       class="uk.ltd.getahead.dwr.convert.DateConverter"/>
        <converter id="bean"       class="uk.ltd.getahead.dwr.convert.BeanConverter"/>
        <convert converter="collection" match="java.util.Collection"/>
        <convert converter="map"        match="java.util.Map"/>
        <convert converter="bean"        match="pfm.dll.InsuDTO"/> <!-- 사용자가 정의한 Bean 사용 -->
        <convert converter="bean"        match="pfm.dll.BaseVO"/>
        <convert converter="bean"         match="java.lang.Exception"/>
        <convert converter="bean"         match="java.lang.StackTraceElement"/>
    </allow>

 

 

    <!-- 자바스크립트에서 Map 형태로 정의된 객체를 JAVA tier로 넘길 경우 사용 -->
    <signatures>
        <![CDATA[
            import java.util.Map;
            import java.util.List;
            import pfm.dll.BranchDLL;
            BranchDLL.calculator(String, String, Map, Map<String, List>, Map, Map, Map, Map,

                   Map,Map<String, List>,Map<String, List>,Map<String, List>);
        ]]>
    </signatures>


</dwr>

출처 : Tong - 妙心主님의 MSP 플젝 관련통

관련글 더보기