검색결과 리스트
Google App Engine에 해당되는 글 2건
- 2010/02/17 Google App Engine for Java 와 스프링(Spring Portfolio) 호환성
- 2010/02/16 첫 번째 GWT over GAE/J 애플리케이션 코드 감상 (2)
글
Google App Engine for Java 와 스프링(Spring Portfolio) 호환성
2010
2010/02/17 08:30
Will it play in App Engine에서 확인 가능. 스프링뿐 아니라 Java Enterprise Edition (Java EE) Technologies와JVM-based Languages, Miscellaneous Java™ Libraries and Frameworks의 세 개 분류로 자바 기술 스택의 주요 구성 요소와의 호환성을 확인할 수 있다.
Spring MVC
Version: 2.5.6
Status: COMPATIBLE
Spring ORM
Version: 2.5.6
Status: COMPATIBLE
Spring Security
Version(s): ?
Status: SEMI-COMPATIBLE
Grails
Version: 1.1.1
Status: SEMI-COMPATIBLE
Spring MVC
Version: 2.5.6
Status: COMPATIBLE
- To see Spring's MVC framework running on App Engine, check out the autoshoppe sample application.
- If
you're using Spring forms (e.g. using the spring-form.tld tag library
and subclassing SimpleFormController), you will need to register custom
editors for your properties. This is covered in http://groups.google.com/group/google-appengine-java/browse_thread/thread/d93fd7385bf85bf7.
Spring ORM
Version: 2.5.6
Status: COMPATIBLE
- To get Spring working with the App Engine-provided JPA interface, follow the instructions at http://objectuser.wordpress.com/2009/05/19/spring-jpa-in-google-app-engine/, which discusses a workaround to the dependency on javax.naming needed for @PersistenceContext. A more complex workaround is available at http://groups.google.com/group/google-appengine-java/browse_thread/thread/187d41712ec1d394.
Spring Security
Version(s): ?
Status: SEMI-COMPATIBLE
- To
work around a ClassNotFoundException, you can use a re-compiled version
of the library which adds a StringInsensitiveComparator class -- the
download is provided at http://www.google-app-engine.com/blog/post/Spring-security-fix-for-google-app-engine.aspx.
- See http://www.dotnetguru2.org/bmarchesson/index.php?p=1100 for tips on how to get Spring Security running with App Engine and GWT (in French).
- See http://groups.google.com/group/google-appengine-java/browse_thread/thread/964e7f5e42840d9c for discussion on the integration.
Grails
Version: 1.1.1
Status: SEMI-COMPATIBLE
- A plugin has been made available which integrates the App Engine SDK with Grails, adding features to upload Grails application automatically and run the local dev server. To download this plugin or see a screencast and tutorial, see http://grails.org/plugin/app-engine.
- As of now, you have to use the "grails app-engine run" command rather than "grails run-app", which blocks other plugins that extend run-app including the GWT plugin. More incompatibilities noted in this thread.
글
첫 번째 GWT over GAE/J 애플리케이션 코드 감상
2010
2010/02/16 08:30
GUI 기반 프로그래밍 전형이다. SDK가 제공하는 인터페이스 구현(implements)를 통해 이벤트 핸들러를 정의한다.
실제 비즈니스 로직은 모아 두었다.(sendNameToServer() 메소드)
GAE/J 가 원격 통신을 추상화시켜주겠지. 직관적인 콜백 메소드 이름(onFailure, on Success)탓에 쉽게 코드를 이해할 수 있다.
다른 GUI 프로그래밍과 다른 부분은 아래 코드다.
RootPanel 클래스의 add() 메소드로 HTML의 특정 영역을 지정하고, GWT 컴포넌트를 삽입한다. HTML 영역지정 코드는 다음과 같다.
이번에는 GAE/J Eclipse 개발환경의 특징이다. SDK로 서버가 배포되는 점에서 GAE/J의 포지션을 알 수 있는 부분이지만, 편리해서 마음에 든다.
얏호! 수 초의 작업 후에 배포에 성공했다.
http://ahnyounghoe.appspot.com/
class MyHandler implements ClickHandler, KeyUpHandler {
/**
* Fired when the user clicks on the sendButton.
*/
public void onClick(ClickEvent event) {
sendNameToServer();
}
/**
* Fired when the user types in the nameField.
*/
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
sendNameToServer();
}
}
/**
* Fired when the user clicks on the sendButton.
*/
public void onClick(ClickEvent event) {
sendNameToServer();
}
/**
* Fired when the user types in the nameField.
*/
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
sendNameToServer();
}
}
실제 비즈니스 로직은 모아 두었다.(sendNameToServer() 메소드)
private void sendNameToServer() {
<중략>
greetingService.greetServer(textToServer,
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
<중략>
}
public void onSuccess(String result) {
<중략>
}
});
<중략>
greetingService.greetServer(textToServer,
new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
<중략>
}
public void onSuccess(String result) {
<중략>
}
});
GAE/J 가 원격 통신을 추상화시켜주겠지. 직관적인 콜백 메소드 이름(onFailure, on Success)탓에 쉽게 코드를 이해할 수 있다.
다른 GUI 프로그래밍과 다른 부분은 아래 코드다.
RootPanel.get("nameFieldContainer").add(nameField);
RootPanel.get("sendButtonContainer").add(sendButton);
RootPanel.get("errorLabelContainer").add(errorLabel);
RootPanel.get("sendButtonContainer").add(sendButton);
RootPanel.get("errorLabelContainer").add(errorLabel);
RootPanel 클래스의 add() 메소드로 HTML의 특정 영역을 지정하고, GWT 컴포넌트를 삽입한다. HTML 영역지정 코드는 다음과 같다.
<td id="nameFieldContainer"></td>
<td id="sendButtonContainer"></td>
<td id="sendButtonContainer"></td>
이번에는 GAE/J Eclipse 개발환경의 특징이다. SDK로 서버가 배포되는 점에서 GAE/J의 포지션을 알 수 있는 부분이지만, 편리해서 마음에 든다.
The development server is part of the SDK. You can‘t use your own development server for App Engine debugging and testing. The App Engine JRE differs from other implementations.
얏호! 수 초의 작업 후에 배포에 성공했다.
http://ahnyounghoe.appspot.com/