블로그 이미지
Max.

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        

Notice

'DWR3.0'에 해당되는 글 3

  1. 2009.11.02 DWR3.0 RC1 Maven Repository 추가하기
  2. 2008.03.26 IWebMvc?
  3. 2008.03.18 Spring에서 DWR Annotation 사용하기(2)
2009.11.02 14:55 개발관련
Maven Central Repository에는 DWR 3.0M1까지 밖엔 없습니다. 이후 RC1이 나왔지만, 아직 추가되진 않았죠. RC1부터는 <dwr:annotation-config/>가 지원됩니다. 사실은 외부 모듈로 지원되다가 3.0 M1부터 지원 지원되기 시작했습니다. 3.0M1에서는 DTD가 2.0에서 업데이트 되지 않아서, XML valiation이 오류나지만, 사용하는데에는 지장없습니다. 그러나 valiation오류가 신경쓰이는데, Maven을 사용한다면, 간단한 Repository 추가로 해결 가능합니다.

1. DWR3.0 RC1을 다운로드 한다.
http://directwebremoting.org/dwr/download.html

2. Maven에 등록한다.
mvn install:install-file -DgroupId=org.directwebremoting -DartifactId=dwr -Dversion=3.0.RC1 -Dpackaging=jar -Dfile=C:\dwr.jar
또는 mvn deploy 명령으로 Repository에 등록시킨다.
mvn deploy:deploy-file -DgroupId=org.directwebremoting -DartifactId=dwr -Dversion=3.0.0.RC1 -Dpackaging=jar -Dfile=C:\dwr.jar -Durl=[Nexus경로] -DrepositoryId=[아이디]

3. Nexus 등록된 화면

4. 이후 Eclipse에서 Maven으로 빌드하거나, Library를 불러올수 있습니다.

요즘 Post할 꺼리가 없어서, 쥐어짜서 올려 봅니다. ㅡㅡ;;;
저작자 표시
신고

'개발관련' 카테고리의 다른 글

Spring Roo 1.0.0.RC3 Released  (0) 2009.11.11
Spring Roo 잡소식(7)  (0) 2009.11.11
DWR3.0 RC1 Maven Repository 추가하기  (0) 2009.11.02
Spring Roo 잡소식(6)  (0) 2009.10.29
Introducing Apache Mahout  (0) 2009.10.28
Spring Roo 잡소식(5)  (0) 2009.10.28
posted by Max.
TAG DWR3.0, maven
2008.03.26 13:15 이전글(~2009)
뭣하는 녀석인고?
M1에서는 Spring 예제에 있는 BookingService에 대해 나름대로 멋진방법으로 소스를 제공했었는데,M2부터는 소스구조 부터 많이 바뀌었다. 마치 옛날(?) OSAF(OpenSeed Application Framework - 아..오픈시드...) 소스코드를 보는듯한 느낌 이랄까? 대부분 소스코드가 Spring 2.5이상의 버전과 Annotation 기반으로 작성되어 있는듯하다.  최신 DWR3.0은 물론 SWF와 Spring Web MVC를 기반으로한 AF를 보는듯 하다. 그러나 아직 좀 복잡해보이는 구성들은 정식릴리즈 될때까지 좀 기다려 봐야 겠다.

It's been less than a month since the preview release of IWebMvc but a lot of things have been added to the platform and I thought it was a good moment to release a new version. I will label it as Milestone 2. In case that you didn't try the first one I've created a short presentation of the framework possibilities. It's the fastest way to get your feet wet with IWebMvc and an interesting reading nonetheless. You can obtain it from the project download page.

And to the topic! This new version packs lots of new functionalities so I'm going to just list them and provide some info (remember that the best way to understand everything is downloading and checking for yourself!):
  • Environment features
    • Additional supported configurations
      In addition to embedded Jetty, IWebMvc can now be run in Tomcat and/or Glassfish (or any other JEE5 compliant AS really). IWebMvc will autodetect the deployment server and apply some custom configuration.
    • Per server configuration
      IWebMvc transaction management can be configured in pretty much any way you like. It offers examples to be easily deployed in different environments: Database pools, full JTA, Spring JPA, driver manager connections, JOTM, with or without JNDI, ...
    • IDE integration
      This version provides Netbeans 6 / Eclipse Europa project files for easy workspace setup.
    • MySQL support
      IWebMvc will accept MySQL (in addition to HSQLDB) as database back end.
    • Installation guide
      In addition to Jetty demo, IWebMvc includes now complete installation instructions to run it in the several supported configurations.
    • Cache & compression filters
      All content served will include HTTP cache headers and will be compressed using gzip, improving performance and saving bandwidth.
    • IE 7 preliminary support
      There are still minor glitches (mainly with file management) but 90% of the features already work.
  • Hibernate features
    • Full Text Search
      In addition to filters, IWebMvc can look up entities searching in all indexed fields.
    • Completely revamped Filter functionality
      Easier to include and more powerful.
    • Support for lazy initialized collections
      Views can wok with uninitialized collections transparently.
  • DWR features
    • Classpath scanning
      DWR will scan the classpath looking for suitable beans (those annotated with @RemoteProxy) and create automatic proxies for them.
    • New DWR read store
      Built from scratch dojo data read store. Tested support for FilteringSelect and/or Grid widgets.
  • dojo features
    • Upgraded to version 1.1 beta 3
      All client code has been migrated to the latest available developing version of dojo (final release of 1.1 expected this month).
    • Theme support
      User can change the appearance at any time. All three (Soria, Tundra, Nihilo) themes from dojo are available. Custom themes can be added with little effort.
    • Entity Locator widget
      Domain entities can be binded using a powerful search widget (in addition to preexistent combobox widget).
    • Video widget
      New video component supporting Flash (.flv) archives
    • Thumbnail widget
      Server side on the fly creation of thumbnails for any image.
    • Grid widget
      In addition to PagingGrid, classical dojo grids are now available
    • List widget
      Any List<DomainEntity> can be created / updated transparently. All binding and validation is automatic as well. A specific tag wrapper and client component have also been created. Other collection widgets can be easily derived from this one.
    • Refactored client code
      Most of JS code has been refactored out of the widgets to a common file to improve performance and maintainability.
In fact, there are more features present but I'll left them undescribed for now. Of course, this version packs dozens of bug fixes as well. But better see it by yourself! So I have to encourage everybody to go to the dowload page and give it a try. Or by checking out the latest sources (svn export http://internna.googlecode.com/svn/trunk/IWebMvc IWebMvc). As always comments, suggestions, contributions, requests are very welcomed using the mailing list. And expect many more new features coming soon :-)


Ajaxian에도 소개되었네...
http://ajaxian.com/archives/iwebmvc-dwr-dojo-spring-and-hibernatejpa

신고
posted by Max.
TAG AF, DWR3.0, OSAF, swf
2008.03.18 09:30 이전글(~2009)

기존에 어노테이션(annotation)을 사용하지 않은 연동 방법은 다음과 같다.

<!-- DTO 객체 -->
 <dwr:configuration>
    <dwr:convert type="bean" class="net.max.account.Account"/>
 </dwr:configuration>

<!-- Ajax 서비스 -->
 <bean id="accountService" class="net.max.account.AccountServiceImpl">
     <dwr:remote javascript="XmlAccountService">   
         <dwr:include method="getAccount" />
      </dwr:remote>
 </bean>


실행 결과
사용자 삽입 이미지

이와같은 설정에서 Ajax 서비스가 많으면 많을수록 XML은 길어 진다.
이것을 Annotation으로 바꿔보자.(web.xml은 기존 설정과 같으니 따로 변경할 필요가 없다.)
기존의 서비스 클래스에 @RemoteProxy, @RemoteMethod를 다음과 같이 붙여준다.(붉은색이 변경된 부분이다.)

@Service
@RemoteProxy(name="AjaxAccountService")
public class AccountServiceImpl implements AccountService {
 
 @RemoteMethod
 public Account getAccount(String id) {
  return new Account(id);
 }
}



@RemoteProxy의 name속성은 외부에 표현될(*.js)파일 이름이 된다. 즉 AjaxAccountService.js 파일로 생성되는 이름이다.
설정은 아래와 같다.(붉은색이 변경된 부분이다.)

<beans xmlns="http://www.springframework.org/schema/beans"
  ......
  xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
  xmlns:dwra="http://www.directwebremoting.org/schema/spring-dwr-annotations"
  xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                .....
                http://www.directwebremoting.org/schema/spring-dwr
                http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
                http://www.directwebremoting.org/schema/spring-dwr-annotations
                http://www.directwebremoting.org/schema/spring-dwr-annotations.xsd">

 <dwr:configuration>
  <dwr:convert type="bean" class="net.max.account.Account"></dwr:convert>
 </dwr:configuration>
 <dwra:annotation-config />



dwra 라는 테그는 원래 없다. 그러니 annotation-config라는 것은 직접 구현해야 한다. 이러한 기능을 하는 것은 DWR3.0에서 지원될것 같다. (하지만 현재는 안된다는거....또한 아직 M2 버젼을 다운받아 테스트 하면 오류가 났다.) 그래서 외국 포험을 뒤져보니 구현한것이 있다. 그 jar를 파일을 받아 classpath 에 넣으면 해당 테크가 잘 동작한다.

실행결과
사용자 삽입 이미지


물론 둘다 혼용해서 사용이 가능하다.

사용자 삽입 이미지


별다른 잇점은 없지만 DWR 기반의 프로젝트라면 XML 설정을 많이 줄이지 않을까 한다.
신고
posted by Max.
TAG DWR3.0
prev 1 next