독도 광고 모금 캠페인


'Works/My Project'에 해당되는 글 6건

  1. 2009.01.19 [스크랩]Spring MVC - 구성 요소 및 처리 흐름
  2. 2009.01.14 Writing JavaScript with DWR 2
  3. 2008.11.18 OZ Report
  4. 2008.11.18 OZ Report Designer
  5. 2008.11.05 Project Terms
  6. 2008.08.07 [Spring2] 자바지기 Spring 프레임워크 강의 - Spring Framework - Confluence 1
2009. 1. 19. 15:39

[스크랩]Spring MVC - 구성 요소 및 처리 흐름


원글 : http://blog.naver.com/jiruchi/10033260451 

스프링 MVC 의 구성 요소

DispatcherServlet  : 클라이언트의 요청을 전달 받아, 컨트롤러에게 클라이언트의 요청을 전달하고 리턴한 값을 View 에 전달하여 응답을                              생성한다.

HandlerMapping   : 클라이언트의 요청 URL 을 어떤 컨트롤러가 처리할지 결정

Controller            : 클라이언트의 요청을 처리후 그 결과를 DispatcherServlet에 알려준다. 

ModelAndView    : 컨트롤러가 처리한 결과 정보 및 뷰 선택에 필요한 정보를 담는다.

ViewResolver      : 컨트롤러의 처리 결과를 생성할 뷰를 결정한다.

View                  : 컨트롤러의 처리 결과 화면을 생성한다.

 

스프링 MVC 의 처리 흐름

 

 

1. 클라이언트 요청이 DispatcherService 에 전달

2. HanderMapping 에 클라이언트 요청을 처리할 컨트롤러 객체를 구함

3. 컨트롤러 객체의 handleRequest() 메서드를 호출하여 요청을 처리

4-5. 컨트롤러의 handleRequest() 메서드는 처리 결과 정보를 담은 ModelAndView 를 리턴

6-7. ViewResolver 응답 결과를 생성할 뷰 객체를 구함

8-9. View 는 클라이언트에 전송할 응답을 생성

 

'Works > My Project' 카테고리의 다른 글

Writing JavaScript with DWR  (2) 2009.01.14
OZ Report  (0) 2008.11.18
OZ Report Designer  (0) 2008.11.18
2009. 1. 14. 13:48

Writing JavaScript with DWR

DWR 을 처음한 나에게 제일 도움이 되는 글이다.. ^^
callback 함수를 처음 써본 난 이 한줄이 왜 그리 어려운건지..
이렇게 쭉~~~ 늘여진 걸 순서대로 줄이니 그야말로 이해가 쉽네..


출처 : http://directwebremoting.org/dwr/browser/intro


Writing JavaScript with DWR

DWR generates Javascript code that is similar to the Java code that exported using dwr.xml.

The biggest challenge in creating a remote interface to match some Java code across Ajax is the (usually) asynchronous nature of Ajax, compared to the synchronous nature of a normal Java call.

DWR solves this problem by introducing a callback function that is called when the data is returned from the server.

There are 2 recommended ways to make a call using DWR. Either using by appending a callback function to the parameter list or by appending a call meta data object.

It is also possible to put the callback function at the start of the parameter list, however this option is not advised because there are some issues when dealing with automatic http objects (see "Alternative Method"). This method mostly remains for backwards compatibility.

Simple Callback Functions

Suppose we have a Java method that looks like this:

public class Remote {
    public String getData(int index) { ... }
}

We can use this from Javascript as follows:

<script type="text/javascript"
    src="[WEBAPP]/dwr/interface/Remote.js"> </script>
<script type="text/javascript"
    src="[WEBAPP]/dwr/engine.js"> </script>
...

function handleGetData(str) {
  alert(str);
}

Remote.getData(42, handleGetData);

'42' is just the parameter to the getData() Java function - see above.

Alternatively you can use the all-in-one-line version:

Remote.getData(42, function(str) { alert(str); });

Call Meta-Data Objects

The alternative syntax is to make use of a call meta-data object that specifies the callback function and (optionally) other options. The example above would become:

Remote.getData(42, {
  callback:function(str) { alert(str); }
});

This method has some advantages: Depending on your style it may be easier to read, but more importantly it allows you to specify extra call options.

Timeouts and Handling Errors

In addition to the callback meta data you can also specify a timeout and an errorHandler. For example:

Remote.getData(42, {
  callback:function(str) { alert(str); },
  timeout:5000,
  errorHandler:function(message) { alert("Oops: " + message); }
});

Finding the callback method

There are some instances when it might not be tricky to distinguish between the various callback placement options. (Remember that Javascript does not support overloaded functions). For example:

Remote.method({ timeout:3 }, { errorHandler:somefunc });

One of the 2 parameters is a bean parameter and the other is a call meta-data object but we have no way of telling which. In a cross-browser world we have to assume that null == undefined. So currently, the rules are:

  • If there is a function first or last then this is the callback function, there is no call meta-data object and the other parameters are the Java args.
  • Otherwise, if the last param is an object with a callback member that is a function then this is call meta-data the other params are Java args.
  • Otherwise, if the first parameter is null we assume that there is no callback function and the remaining params are Java args. HOWEVER we check to see that the last param is not null and give a warning if it is.
  • Finally if the last param is null, then there is no callback function.
  • Otherwise, this is a badly formatted request - signal an error.

Creating Javascript objects to match Java objects

Suppose you have an exposed Java method like this:

public class Remote {
  public void setPerson(Person p) {
    this.person = p;
  }
}

And Person looks like this:

public Person {
  private String name;
  private int age;
  private Date[] appointments;
  // getters and setters ...
}

Then you can call this from Javascript like this:

var p = {
  name:"Fred Bloggs",
  age:42,
  appointments:[ new Date(), new Date("1 Jan 2008") ]
};
Remote.setPerson(p);

Any fields missing from the Javascript representation will be left unset in the Java version.

Since the setter returned 'void' we did not need to use a callback and could just leave it out. If you want to be notified of the completion of a server-side method that returns void then you can include a callback method. Obviously DWR will not pass any data to it.


'Works > My Project' 카테고리의 다른 글

[스크랩]Spring MVC - 구성 요소 및 처리 흐름  (0) 2009.01.19
OZ Report  (0) 2008.11.18
OZ Report Designer  (0) 2008.11.18
2008. 11. 18. 18:02

OZ Report

를 사용할 때
oza를 로컬에서 실행하고 ozr을 호출하다가 odi를 못찾는다는 에러메시지가 나면

oza에 ozr이 포함하고 있는 odi를 포함하고 있는지 확인하도록 한다.

'Works > My Project' 카테고리의 다른 글

Writing JavaScript with DWR  (2) 2009.01.14
OZ Report Designer  (0) 2008.11.18
Project Terms  (0) 2008.11.05
2008. 11. 18. 17:59

OZ Report Designer

OZ 제품군들을 실행하다가
처음에 JVM 에러가 나면
OZ Report Designer



C:\Program Files\Forcs\OZ XStudio\OZ Report Designer 3.5[해당OZ 어플]\config\launch.cfg

에 JRE_PATH 를 변경해 주도록 한다.

'Works > My Project' 카테고리의 다른 글

OZ Report  (0) 2008.11.18
Project Terms  (0) 2008.11.05
[Spring2] 자바지기 Spring 프레임워크 강의 - Spring Framework - Confluence  (1) 2008.08.07
2008. 11. 5. 09:35

Project Terms


CMS : 기지국 장비

RCS :  광중계기 감시장치

'Works > My Project' 카테고리의 다른 글

OZ Report  (0) 2008.11.18
OZ Report Designer  (0) 2008.11.18
[Spring2] 자바지기 Spring 프레임워크 강의 - Spring Framework - Confluence  (1) 2008.08.07
2008. 8. 7. 10:08

[Spring2] 자바지기 Spring 프레임워크 강의 - Spring Framework - Confluence

Spring 2.0
Spring Dependency Injection

기본 Spring 프레임워크 API 사용예제

Advanced Spring 프레임워크 API 사용예제

Spring 프레임워크 개발 전략

  • Spring의 Bean Definition 설정 파일 관리 전략 : Spring의 설정 파일은 작은 애플리케이션의 경우 단 하나만으로 모든 Bean을 관리할 수 있다. 그러나 중/대규모의 애플리케이션일 경우 하나만으로 관리하기에는 유지보수가 힘들어 질 수 박에 없다. 이 같은 한계를 극복할 수 있는 방법에 대하여 살펴본다.
  • Spring 프레임워크에서의 테스트 전략 : Spring 프레임워크를 이용할 경우 큰 장점중의 하나가 테스트의 용이성이다. Spring 프레임워크 기반하에서의 테스트 전략에 대하여 살펴본다.
Spring Aspect Oriented Programming

기본적인 Spring AOP 기능

Advanced Spring AOP 기능

  • Introduction 시작하기 : AOP의 개념중 Introduction이라는 개념이 있다. Introduction은 이미 구현되어 있는 구현체에 완전히 새로운 기능을 추가하는 것이 가능하다. Introduction 기능을 이용하여 이 같은 작업이 어떻게 가능한지에 대하여 살펴본다.
  • AOP를 Bean Definition에서 선언적으로 사용하기 : ProxyFactory를 이용하여 AOP 기능을 프로그램에서 사용하는 것이 가능하다. 그러나 Spring 프레임워크에서는 모든 Bean Definition을 선언적으로 사용하듯이 AOP 적용 또한 선언적으로 하고 싶다. Spring 프레임워크에서는 이 방법을 어떻게 해결하고 있는지 살펴본다.
  • Automatic Proxying 사용 예제 : Bean Definition을 설정할 때마다 특정 AOP를 추가하는 것은 여간 번거로운 작업이 아니다. Automatic Proxying을 통하여 하나의 Aspect가 특정 패턴을 가지는 모든 Bean에 적용되는 방법에 대한 예제를 살펴본다.
  • Spring 프레임워크와 AspectJ의 통합 : Spring AOP가 AOP의 모든 기능을 제공하는 것이 아니다. Spring AOP가 지원하지 못하는 기능들을 AspectJ가 지원할 수 있는 경우가 대부분이다. 따라서 Spring 프레임워크와 AspectJ를 통합할 수 있다면 상당히 유용할 것이다.

Spring 프레임워크 개발 전략

  • AOP를 사용하기 위한 프로젝트 개발 전략 : AOP 개념을 프로젝트에 적용하기 위해서는 기존의 프로젝트 개발 방법과 달라지는 부분이 있다. AOP를 적용할 경우 프로젝트 초반에 수립해야 될 부분과 그렇지 않아도 되는 부분등에 대하여 다룬다.
  • 다양한 AOP 툴중에서 적절한 툴을 선택하기 위한 전략 : 현재 자바 진영에서 사용할 수 있는 프레임워크는 Spring AOP, JBoss AOP, AspectJ 등이 일반적으로 사용되고 있다. 이 프레임워크 어떠한 프레임워크를 사용할 것인지를 선택하는 것이 또한 중요하다. 이와 같은 프레임워크의 선정 방법에 대하여 다룬다.
Spring JDBC
Spring Transaction

Transaction : Transaction에 대한 기본적인 개념과 Spring에서 지원하는 Transaction에 대하여 살펴본다.

Transaction은 어느 곳에서 처리되어야 할까? : Transaction은 어느 레이어에서 처리해야 할까? 지금까지의 개발 방식과 Spring을 이용할 경우 어떻게 해결할 수 있는지에 대하여 살펴본다.

Spring MVC

Basic

  • 모델 1과 모델2의 차이점 : 모델1과 모델2의 차이점에 대하여 비교분석한다.
  • Spring MVC에서 클라이언트 요청의 처리 과정 : Spring MVC는 클라이언트에서의 요청을 바로 JSP가 처리하는 것이 아니라 DispatcherServlet이라는 메인 Servlet에서 제어하게 된다. 이 Controller에 의하여 처리되는 과정을 살펴본다.
  • HandlerMapping
  • Controller 구조 및 역할 : Spring 프레임워크는 다양한 요청에 대한 처리를 위하여 여러가지 종류의 Controller를 제공하고 있다. 각 Controller의 종류 및 사용 방법을 살펴보도록 한다.
  • SimpleFormController의 Workflow : SimpleFormController는 Spring 프레임워크에서 한 페이지의 Form 페이지를 처리하기 위하여 유용하게 사용할 수 있는 Controller이다. SimpleFormController가 처리되는 Workflow에 대하여 알아본다.
  • ViewResolver
  • View

참고문서

Spring Test
Spring JMS

'Works > My Project' 카테고리의 다른 글

OZ Report  (0) 2008.11.18
OZ Report Designer  (0) 2008.11.18
Project Terms  (0) 2008.11.05