sitelink1  
sitelink2  
sitelink3  
extra_vars4  
extra_vars5  
extra_vars6  
http://javaora.tistory.com/entry/DWR-%EC%82%AC%EC%9A%A9%EC%9D%84-%EC%9C%84%ED%95%9C-webxml-%EC%84%A4%EC%A0%95-%EB%B0%A9%EB%B2%95  DWR을 사용하기 위해 web.xml에 설정해야하는 최소한의 내용은 아래와 같다.

·미리보기 | 소스복사·
  1. <servlet>  
  2.   <servlet-name>dwr-invoker</servlet-name>  
  3.   <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>  
  4. </servlet>  
  5. <servlet-mapping>  
  6.   <servlet-name>dwr-invoker</servlet-name>  
  7.   <url-pattern>/dwr/*</url-pattern>  
  8. </servlet-mapping>  

  DWR 2.x 에서는 org.directwebremoting.servlet.DwrServelet 을 호출해야하나 uk.ltd.getahead.dwr.DWRServlet 을 호출해도 사용은 가능하다. DWR 1.x 에서는 꼭 uk.ltd.getahead.dwr.DWRServlet 을 사용해야한다.

  추가적으로 몇가지 추가가능한 servlet 파라미터가 있다. 


DWR 설정(Configuring DWR)

  DWR 확장을 위한 표준적인 메카니즘은 init-params 를 사용하는 것이다. 가장 일반적인 init-param 은 test mode 를 enable 시키는 것이다. 이러한 파라미터들중 하나를 사용하는 방법은 <servlet> 구문을 아래와 같이 변경하는 것이다.

·미리보기 | 소스복사·
  1. <servlet>  
  2.   <servlet-name>dwr-invoker</servlet-name>  
  3.   <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>  
  4.   <init-param>  
  5.     <param-name>debug</param-name>  
  6.     <param-value>true</param-value>  
  7.   </init-param>  
  8. </servlet>  

  DWR 은 좀 더 많은 init-param 을 지원한다. 아래 파라미터들 이외에도 몇가지 파라미터들이 더 있으나 아래 표시되지 않는 파라미터들은 다음 버젼에선 deprecate 될 예정이다.

Security Parameters

allowGetForSafariButMakeForgeryEasier
Version : 2.0
Default : false
Notes : true 시 Safari 1.x 에서 DWR 을 작동하게 한다.

crossDomainSessionSecurity
Version : 2.0
Default : true
Notes : false 시 다른 도메인으로부터의 요청(request)를 가능하게 한다. 이것을 가능하게 하면 중대한 보안상의 위험이 될 수 도 있다. 반드시 위키페디아의 CSRF 에 대한 내용등을 참고한뒤 해당사항에 대한 이해를 한뒤 설정을 변경해야 한다. 

allowScriptTagRemoting
Version : 2.0 rc4
Default : true
Notes : true 시 Script Tag remoting 을 가능하게 한다. 이것을 가능하게 하면 중대한 보안상의 위험이 될 수 도 있다. 반드시 위키페디아의 CSRF 에 대한 내용등을 참고한뒤 해당사항에 대한 이해를 한뒤 설정을 변경해야 한다. 

debug
Version : 1.0
Default : false
Notes : true 시 debug/test page 기능을 가능하게 한다.(DWR이 dwr.xml에 등록된 클래스들에 대한 테스트 페이지를 생성하게 된다.)

scriptSessionTimeout
Version : 2.0
Default : 1800000(30분)
Notes : 얼마나 빨리 scriptSession이 종료되는지를 지정함.

maxCallCount
Version : 2.0 rc2 and 1.1.4
Default : 20
Notes : 한번에 일을 처리 할 수 있는 최대 콜(call) 수.(동시에 이용가능한 DWR의 Call 수를 의미하는 듯 함.) - Dos 공격을 예방 할 수 있다.


Ajax Server Load Protection Parameters

activeReverseAjaxEnabled
Version : 2.0 rc3
Default : false
Notes : true로 세팅시 polling과 comet 이 가능해진다. 이는 DWR이 server overload 예방 메카니즘을 가지고 있다 하더라도 서버에 많은 부하(load)를 줄 수 있다. rc3 이전에는 pollAndCometEnabled 라고 불리었다.

pollAndCometEnabled
Version : 2.0 rc1
Default : false
Notes : activeReverseAjaxEnabled 참고.

maxWaitingThreads
Version : 2.0
Default : 100
Notes : 최대 thread 의 수(오직 thread-dropping을 지원하지 않는 servlet engine 에서만 사용한다.)

maxHitsPerSecond
Version : 2.0
Default : 40
Notes : 최대 hit 의 수(오직 thread-dropping을 지원하지 않는 servlet engine 에서만 사용한다.)


Other Parameters

[Interface Name]
Version : 1.1
Default : 특정 인터페이스의 구현체로 특정 인터페이스를 오버라이드(override) 하는 것을 허용한다.
Notes : 재컴파일이 필요하다.(Plug-ins 부분 참고 필요)

ignoreLastModified
Version : 2.0
Default : false
Notes : 기본으로 DWR 은 Last-Modified/ETags 를 제공한다. 이를 true 로 세팅하면 이 기능을 제공하지 않는다.

scriptCompressed
Version : 1.1 - 2.0
Default : false
Notes : 3.0 에서는 DWR 은 자동으로 결과물 scipt를 실시간으로 압축을 하며, debug 모드에서는 비압축상태로 되어있다. 'scriptCompressed' init-param이 필요하지 않다. DWR은 ShrinkSafe 나 YUI 압축기(compressor) 가 classparh 내에 있으면 이를 자동적으로 사용하고 그렇지 않으면 빌트인(built-in) 된 simpler 압축기(compressor)를 사용한다. 3.0 이전의 버젼들은 simpler 압축기만 가능하며, 'scriptCompressed' init-param 설정을 true 로 세팅해주어야 한다. 이는 문서화되지 않은 파라미터인 compressionLevel과 연관이 있다.

sessionCookieName
Version : 2.0
Default : JSESSIONID
Notes : DWR 은 document location 검사와 현재 sessionid 의 추출에 의한 URL re-writing 을 지원한다. 몇몇 servlet engine은 비표준 쿠키 이름을 사용한다.

welcomeFiles
Version : 2.0
Default : index.html, index.htm, index.jsp
Notes : web.xml 의 <welcome-file-list>를 override 한다.

normalizeIncludesQueryString
Version : 2.0 rc3
Default : false
Notes : 

overridePath
Version : 2.0
Default : null
Notes : 


  이상으로 DWR을 사용하기 위한 web.xml 설정 방법들에 대해 알아보았다.

번호 제목 글쓴이 날짜 조회 수
20 DWR을 이용해서 객체를 JSON으로 변환하기 황제낙엽 2011.03.25 34
19 YUI 스크랩 황제낙엽 2009.03.12 16
18 Spring에서 DWR Annotation 사용하기 file 황제낙엽 2009.10.28 151
17 DWR 2.0 and Spring 2.x - The DWR namespace handler 황제낙엽 2009.05.16 124
16 Building Your Own Widget Library with YUI 황제낙엽 2009.04.16 321
15 YUI 응용프로그램 만들기 (Writing Your First YUI Application) 황제낙엽 2009.03.12 32
14 MethodChain이란? 황제낙엽 2009.03.12 33
13 DWR2.x 와 Spring2.x에서 설정 황제낙엽 2009.03.12 15
12 [guni] DWR 사용시 Session 값 얻기 황제낙엽 2009.03.12 18
11 [guni] Spring + DWR 을 이용한 Form Submission처리... 황제낙엽 2009.03.12 9
10 [Whiteship's Note] Spring + Ajax with DWR (Revolution) file 황제낙엽 2009.03.12 68
9 [Whiteship's Note] Spring + Ajax with DWR (Coding) file 황제낙엽 2009.03.12 52
8 [Whiteship's Note] Spring + Ajax with DWR 황제낙엽 2009.03.12 24
7 [흰둥이와 백설이] DWR - Reverse Ajax part 2 : Configuring Reverse Ajax 황제낙엽 2009.03.12 39
6 [흰둥이와 백설이] DWR - Reverse Ajax part1 황제낙엽 2009.03.12 31
» [흰둥이와 백설이] DWR 사용을 위한 web.xml 설정 방법 황제낙엽 2009.03.12 52
4 [흰둥이와 백설이] Overview Of DWR - DWR : JAVA를 위한 쉬운 AJAX 황제낙엽 2009.03.12 18
3 Direct Web Remoting 황제낙엽 2009.03.12 28
2 Reverse AJAX in DWR 2.0 황제낙엽 2007.08.23 49
1 흰둥이’s DWR 강좌 file 황제낙엽 2007.08.23 45