at flash.display::Stage/set displayState()
전체 글
- [FLEX] 브라우져 풀스크린 모드 전환 2009.04.14
- [펌] 고스트부팅씨디 만들기 2009.04.08
- ActionScript 3.0 Code 라이브러리 모음 2009.04.07
- [펌]Tree에 바인딩 된 XML의 특정 attribute로 아이템을 검색하고 폴더 확장하기 2009.04.06 1
- [FLEX] 현재 날짜 구하기 2009.04.03
- [MySql] RowNum 사용하기 2009.04.02
- iBATIS 참고사이트 2009.03.31
- [FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제4 - 클라이언트단구현 2009.03.31 1
- [FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제3 - 서버단구현2 2009.03.31
- [FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제2 - 서버단구현1 2009.03.31
[FLEX] 브라우져 풀스크린 모드 전환
at flash.display::Stage/set displayState()
[펌] 고스트부팅씨디 만들기
준비물: 디스켓 1장, cd롬 1장,
1. 고스트2003을 실행 -->ghost유틸리티를 클릭
표준 ghost 부트 디스크 클릭 후 <다음>
<다음>
<다음>
시스템에서 고스트 프로그램 위치를 찾아줍니다 <다음>
A드라이버에 디스켓 1장 삽입 후 <다음>
<다음>
디스켓 넣으면 포멧창이 뜸 ....포멧실행 후 <다음>
이 작업이 끝나면 A디스켓에 GHOST폴더와 autoexe.bat를 비롯 6개 화일이 생성됨
참고 이 디스켓으로 부팅하면 고스트가 부팅됩니다. 하지만 cd롬으로 구우면 동작 안됩니다..
cd롬으로 부틴하려면 winimage프로그램으로 이미지 파일을 만들어서 cd롬을 궈야 합니다.
프로그램은 여기서 다운 받아서 하세요 최신버전 winima80.exe 이 있네요 http://winimage.com/download.htm
winimage란 프로그램을 구동 후 disk --> create cd-rom iso image를 클릭하면
A디스켓을 읽어옵니다
A 디스켓내용을 보여주면...
file --> save as
해서 임의의 디렉토리에 저장합니다. 이때 파일형식을 ima로 지정
(여기선 c:\temp\xp.ima로 저장)
작업이 끝났습니다. winimage를 종료하고 nero를 실행하세요
nero5인데 좌측 cd-rom부트를 클릭하고
이미지 화일에 점 찍으시고 아까 저장한 xp.ima위치를 지정하고 우측 상단의 <새파일>을 크릭합니다 cd에 추가할 file있으면 추가하신 후...이후 작업은 nero굽는식으로 구우면 됩니다.
ActionScript 3.0 Code 라이브러리 모음
Adrian Parr’s Blog 에 올라온 ActionScript 3.0 Code 라이브러리 모음이다. 매우 유용해서 긁어왔다.
3D Engines
- Papervision3D
http://blog.papervision3d.org/ - Away 3D
http://www.away3d.com/
- Sandy 3D
http://www.flashsandy.org/
- Alternativa Platform
http://blog.alternativaplatform.com/en/
- FIVe3D
http://five3d.mathieu-badimon.com/
- WireEngine3D (we3d) - A lightweight and fast 3D Engine for Flash 8/9.
http://osflash.org/we3d/
- Sharikura
http://temp.roxik.com/datas/physics/
3D Game Engines
- PaperWorld 3D
http://paperworld3d.com/
3D Animation Framework
- Cast3D
http://www.cast3d.org/
3D Physics Engines
- WOW-Engine
http://seraf.mediabox.fr/wow-engine/
Animation Tweening Kits
- Tweener - A class for creating tweens in actionscript 2 and 3 - because there’s infinity between 0 and 1.
http://code.google.com/p/tweener/
- TweenLite
http://blog.greensock.com/tweenliteas3/
- TweenMax
http://blog.greensock.com/tweenmaxas3/
- Tweensy
http://www.lostinactionscript.com/blog/index.php/2008/08/31/as3-tween-engine-tweensy-preview/
- GoASAP (ActionScript Animation Platform)
http://www.goasap.org/
- AS3 Animation System 2.0
http://www.boostworthy.com/blog/?p=170
- Animation Package
http://www.alex-uhlmann.de/flash/animationpackage/
- KitchenSync - KitchenSync is an ActionScript 3.0 library for sequencing animations and other time-based actions.
http://code.google.com/p/kitchensynclib/
- Gyro - A tween and animation library for ActionScript 3
http://code.google.com/p/gyro-actionscript-animation/
- gTween
http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html
- HydroTween + HydroSequence (based on GoASAP)
http://blog.hydrotik.com/2008/07/19/hydrotween-hydrosequence-rev32/
- AS3 Easing
http://www.uza.lt/codex/as3-easing/
- Twease
http://code.google.com/p/twease/
2D Physics Engines
- APE (Actionscript Physics Engine)
http://www.cove.org/ape/index.htm
- Box2DFlashAS3
http://box2dflash.sourceforge.net/
- FOAM - 2D Rigid Body Physics Engine
http://code.google.com/p/foam-as3/
- glaze - 2D Rigid Body Dynamics & Game Engine for Actionsctipt 3
http://code.google.com/p/glaze/
- motor2
http://lab.polygonal.de/motor_physics/
- Fisix Engine
http://www.fisixengine.com/default.asp
- PopShapes
http://lab.andre-michelle.com/physics-engine/
Security
- AS3Crypto
http://crypto.hurlant.com/
Audio Libraries
- Popforge - ActionScript 3 code sandbox for various packages
http://code.google.com/p/popforge/
Particle Systems
- FLiNT
http://flintparticles.org/
- Partigen (Not free)
http://desuade.com/products/partigen/ - Pulse Particle System - A general purpose AS3 particle system.
http://www.rogue-development.com/pulseParticles.html - Emitter - ActionScript 3.0 particle FX engine
http://code.google.com/p/emitter/
Data Visualization
- Flare - Create interactive data visualizations for the web
http://flare.prefuse.org/
Loading Kits
- BulkLoader - A library for managing multiple loadings with Actionscript 3 (AS3).
http://code.google.com/p/bulk-loader/
- Masapi
http://code.google.com/p/masapi/
- QueueLoaderAS3
http://code.google.com/p/queueloader-as3/ - SomaLoader
http://www.soundstep.com/blog/downloads/somaloader/
OOP Frameworks
- Cairngorm
http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm
- PureMVC
http://puremvc.org/
- Mate
http://mate.asfusion.com/
- Gaia
http://www.gaiaflashframework.com/
- Slide
http://code.google.com/p/flex-slide/
- Guasax
http://www.guasax.com/
- VEGAS
http://code.google.com/p/vegas/
- Parsley
http://www.spicefactory.org/parsley/
- LowRa - AS3 version of pixlib
http://code.google.com/p/lowra/ - CASA Lib - An Open Source Code Library for ActionScript 2.0 & 3.0
http://casalib.org/
Other APIs and libraries
- facebook-actionscript-api - Actionscript API for the Facebook platform
http://code.google.com/p/facebook-actionscript-api/
- as3facebooklib - ActionScript 3.0 API for Facebook
http://code.google.com/p/as3facebooklib/
- Yahoo Maps API
http://developer.yahoo.com/flash/maps/
- corelib - ActionScript 3.0 library for several basic utilities (JPEG Encoding, MD5 Hashing, JSON Serialization).
http://code.google.com/p/as3corelib/
- as3flexunitlib - ActionScript 3.0 framework for unit testing.
http://code.google.com/p/as3flexunitlib/
- as3flickrlib - ActionScript 3.0 API for Flickr
http://code.google.com/p/as3flickrlib/
- as3mapprlib - ActionScript 3.0 API for Mappr
- http://code.google.com/p/as3mapprlib/
- as3syndicationlib - ActionScript 3.0 library for handling syndication feeds.
http://code.google.com/p/as3syndicationlib/
- as3odeolib - ActionScript 3.0 API for Odeo
http://code.google.com/p/as3odeolib/
- as3youtubelib - ActionScript 3.0 API for YouTube
http://code.google.com/p/as3youtubelib/
- as3ebaylib - ActionScript 3.0 API for eBay
http://code.google.com/p/as3ebaylib/
- as3awss3lib - ActionScript 3.0 library for interacting with Amazon S3
http://code.google.com/p/as3awss3lib/
- as3soundeditorlib - Actionscript 3.0 library for sound playback, spectrum display, and cue point display
http://code.google.com/p/as3soundeditorlib/
- as3ds - AS3 Data Structures For Game Developers
http://code.google.com/p/as3ds/
- as3notificationlib - A notification framework written in AS3 for the Adobe Integrated Runtime (AIR)
http://code.google.com/p/as3notificationlib/
- as3preferenceslib - An AIR library for storing preferences
http://code.google.com/p/as3preferenceslib/
- as3nativealertlib - An AIR alert that appears in a native window
http://code.google.com/p/as3nativealertlib/
- ASCOLLADA - actionscript library for parsing Collada files
http://code.google.com/p/ascollada/
- FZip - An Actionscript 3 class library to load, modify and create standard ZIP archives.
http://codeazur.com.br/lab/fzip/
- lastfm-as3 - Actionscript 3.0 API to access the Last.fm web services
http://code.google.com/p/lastfm-as3/
- MapQuest
http://company.mapquest.com/mqbs/4a.html
- Modest Maps - A display and interaction library for tile-based maps in Flash
http://www.modestmaps.com/
- as3cards - An ActionScript 3.0 card engine and example games
http://code.google.com/p/as3cards/
- flexircclient - ActionScript 3 based IRC library
http://code.google.com/p/flexircclient/
- AsWing - A GUI framework and library that allows programmers to make their flash application(or RIA) UI easily.
http://www.aswing.org/
- as3httpclient - ActionScript 3 utils/classes to extend HTTP/HTTPS APIs in Flash Player 9 (onwards)
http://code.google.com/p/as3httpclient/
- DistortionTweener
http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/
- ascanvas - An adapter of HTML Canvas and fl.display.Graphics
http://code.google.com/p/ascanvas/
- dopplr-as3 - actionscript 3 code for accessing data from dopplr.com’s api
http://code.google.com/p/dopplr-as3/
- FC64 - an Open-Source Commodore 64 Emulator
https://mirror1.cvsdude.com/trac/osflash/fc64/
- FFilmation - AS3 Isometric Engine
http://www.ffilmation.org/website/
- Google Maps API
http://code.google.com/apis/maps/documentation/flash/intro.html
- FVNC - VNC Client for Flash Player 9 and above
http://osflash.org/fvnc
- AS3 Parametric Curve Library
http://www.algorithmist.net/as3pc.html
- AWI - AMFPHP-WordPress Integration
http://www.klr20mg.com/awi/ (in Spanish) - as3webservice - Open-source Webservice class implementation in AS3 for Flash CS3 IDE
http://code.google.com/p/as3webservice/
- as3jayrock - AS3 wrapper for Jayrock communication
http://code.google.com/p/as3jayrock/ - ASAP Library - A library for the development of maintainable, multi-movie, interactive applications.
http://asaplibrary.org/
[펌]Tree에 바인딩 된 XML의 특정 attribute로 아이템을 검색하고 폴더 확장하기
Tracy Spratt <tspratt@lariatinc.com> 의 아이디어입니다
<?xml version="1.0" encoding="utf-8"?>
<!-- Tree control example. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()">
<mx:Script><![CDATA[
[Bindable]
public var _xmlData:XML;
public function initApp():void
{
_xmlData = <element eid="hello">
<element eid="world">
<element eid="123"/>
<element eid="graham"/>
<element eid="weldon">
<element eid="office">
<element eid="thing"/>
<element eid="boat"/>
<element eid="chair"/>
</element>
<element eid="person"/>
</element>
</element>
</element> ;
}//initapp
private function expandParents(xmlNode:XML):void
{
while (xmlNode.parent() != null) {
xmlNode = xmlNode.parent();
myTree.expandItem(xmlNode,true, false);
}
}//expandParents
private function findNodeById(sId:String):void
{
var xmllistDescendants:XMLList = _xmlData.descendants().(@eid == sId);
expandParents(xmllistDescendants[0]);
myTree.selectedItem = xmllistDescendants[0];
}//findNodeById
]]></mx:Script>
<mx:Panel title="Tree Control Example" height="75%" width="75%"
paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
<mx:HBox>
<mx:TextInput id="tiId" text="boat" />
<mx:Button label="Find" click="findNodeById(tiId.text)" />
</mx:HBox>
<mx:Tree id="myTree" width="50%" height="100%" labelField="@eid"
showRoot="false" dataProvider="{_xmlData}" />
</mx:Panel>
</mx:Application>
[FLEX] 현재 날짜 구하기
아래 코드를 좀 응용하면 될듯...
var sday:String = nowDate.date.toString();
var smonth:String = (nowDate.month+1).toString();
if(sday.length == 1){
sday = "0"+sday;
}
if(smonth.length == 1){
smonth = "0"+smonth
}
snowDate = nowDate.fullYear.toString()+"-"+ smonth +"-"+sday;
[MySql] RowNum 사용하기
FROM (SELECT @rownum:=0) r, mytable t;
iBATIS 참고사이트
reference
한글문서
- Introduce Ibatis - ibatis 2.0에 대한 소개
- Object-Relational Mapping with SQLMaps - ibatis를 이용한 Object-Relational Mapping(OnJava 2005.02.02).
- ORM의 또 다른 핵 iBATIS SQLMaps - 마소에 실렸던 SQLMaps관련 기사
- 간결한 데이터 매퍼의 대명사, iBATIS SQLMaps 활용법 - 마소에 실렸던 SQLMaps관련 기사
- ibatis tip - ibatis 관련 팁
- Spring SQLMaps integration - Spring과 iBATIS SQLMaps의 연동 관련 설정.(작업중)
- ibatis using problems - ibatis사용중에 흔히 발생되는 문제와 대처법
- ibatis Oracle clob type handler - Oracle CLOB타입의 데이터를 처리하기 위한 type handler
- iBATIS JDBC Transaction Type - iBatis SqlMap에서 트랜잭션 매니저 타입이 'JDBC'인 경우 DB커넥션 사용.
- kwon37xi iBATIS DEBUG - 권남님의 iBATIS디버그 이야기
- use remapResults Attribute - 동적으로 쿼리를 가져오기 위해 remapResults속성을 사용하자.
- How do I configure a Jakarta DBCP-datasource - DBCP설정법
- reuse SQL-fragments - SQL문의 일부를 재사용하자
- DateTimeTypeHandlerCallback - DateTimeTypeHandlerCallback.java
- iBATIS Log4j Setting To SQL Logging - iBATIS에서 생성되는 SQL문을 보기 위한 log4j셋팅
영문문서
- Improve persistence with Apache Derby and iBATIS: PART 1 - [PART 1] Apache Derby와 iBATIS를 사용한 퍼시스턴스 향상시키기(영문링크)
- Improve persistence with Apache Derby and iBATIS: PART 2 - [PART 2] Apache Derby와 iBATIS를 사용한 퍼시스턴스 향상시키기(영문링크)
- Improve persistence with Apache Derby and iBATIS: PART 3 - [PART 3] Apache Derby와 iBATIS를 사용한 퍼시스턴스 향상시키기(영문링크)
링크
- How do I use a BLOB or CLOB - BLOB와 CLOB 사용하기
- Tired of hand coding JDBC? Use iBatis as a data mapping framework instead developerWorks - JDBC코딩에 지쳤는가.? 대신에 iBATIS를 사용해보라.(영문)
관련툴
- SQL2iBatis - SQL문이 저장되어 있는 sql파일을 인자로 줘서 iBatis용 자바소스와 SQL Maps 맵핑 xml파일 생성하기
- DDL2iBatis-Code Generator For iBatis-DDL2iBatis 사용가이드(한글판)
- DDL2iBatis-DDL2iBatis 프로그램 압축파일
<div class="note"> 위키북스에서 출판되는 iBATIS In Action에서 독자의 이해를 돕고자 하는 사항에 대해 정보를 제공한다. </div>
샘플코드
- queryForMap()의 사용예제 - iBATIS사용시 대개의 개발자는 queryForObject와 queryForList를 사용한다. 그래서 queryForMap에 대한 이해나 예제가 부족한 실정이다. 그래서 이해를 돕고자 예제를 제공한다.
- Procedure 사용예제 - Procedure사용예제를 다룬다. IN, OUT, INOUT타입을 다룬다.
- iBATIS Error Message - iBATIS를 사용하면서 겪게 되는 에러 메시지.
[FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제4 - 클라이언트단구현
<< service-config.xml파일을 수정 >>
<factory id="springfactory" class="flex.messaging.factory.SpringFactory" />
</factories>
<< remote-config.xml 파일을 수정 >>
<properties>
<factory>springfactory</factory>
<source>productManager</source>
</properties>
</destination>
자세히 보시면 factory는 위에 service-config.xml파일에 정의한 놈이고, source는 bean이름입니다.
즉 applicationContext.xml파일에 정의한 그 bean이름을 저기에 적어 놓으면 됩니다.
그러면 그 bean을 flex로 가져와서 쓸 수 있습니다.
아 그리고 프로젝트에서 이상하게 contextroot가 WebContent로 되어있는데 프로젝트이름으로 고쳐줍시다-_-;
context root를 프로젝트이름(SpringAndBlazeds)으로 바꿔줍시다.
<< FLEX 작성 >>
자 그러면 flex_src에 있는 SpringAndBlazeds.mxml을 수정해봅시다.
SpringAndBlazeds.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
applicationComplete="init();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.RemoteObject;
private function init():void {
var remoteObject:RemoteObject = new RemoteObject();
remoteObject.destination = "productmanager";
remoteObject.addEventListener(ResultEvent.RESULT, resultHandler);
remoteObject.addEventListener(FaultEvent.FAULT, faultHandler);
remoteObject.getProducts();
}
private function resultHandler(event:ResultEvent):void{
dg.dataProvider = event.result;
}
private function faultHandler(event:FaultEvent):void{
Alert.show("실패 메세지 : " + event.fault.message);
}
]]>
</mx:Script>
<mx:DataGrid id="dg" width="100%" height="100%" />
</mx:Application>
간단하게 Manager에 있는 getProducts를 호출해서 DataGrid에 넣는 코드입니다.
<< 실행 >>
이클립스 오른쪽아래에 server에다가 SpringAndBlazeds프로젝트를 추가합니다.
서버에 대고, 오른쪽버튼누르면, Add and Remove Project클릭해서 추가하면 됩니다.
서버를 가동합니다.
Run Flex Application을 실행해봅시다!
- Spring 프레임워크의 부족한 점 보안
- Flex에서 DataBase의 연동시 처리 방법 보안
- iBatis의 데이터 베이스 정의 및 사용방법 보안
[FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제3 - 서버단구현2
package springapp.service;
import java.util.List;
import springapp.domain.Product;
public interface ProductManager {
public List<Product> getProducts();
}
package springapp.service;
import java.util.List;
import springapp.dao.ProductDao;
import springapp.domain.Product;
public class ProductManagerImpl implements ProductManager {
private ProductDao productDao;
@Override
public List<Product> getProducts() {
return productDao.getProductList();
}
public void setProductDao(ProductDao productDao) {
this.productDao = productDao;
}
}
getProducts라는 함수는 Dao에서 getProductList를 호출하는 놈이네요.
요 아래에는 setter가 있네요. 이건 spring에서 DI를 하기위해 존재하는 setter입니다^^
서비스도 완성이 되었네요! 이제 설정파일을 작성해봅시다.
WEB-INF/applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<!-- Enable @Transactional support -->
<tx:annotation-driven />
<!-- Enable @AspectJ support -->
<aop:aspectj-autoproxy />
<aop:config>
<aop:advisor pointcut="execution(* *..ProductManager.*(..))"
advice-ref="txAdvice" />
</aop:config>
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="save*" />
<tx:method name="get*" read-only="true" />
</tx:attributes>
</tx:advice>
<bean id="productManager"
class="springapp.service.ProductManagerImpl">
<property name="productDao" ref="productDao" />
</bean>
</beans>
Dao부분의 설정파일인 applicationContext-ibatis.xml파일을 봅시다.
WEB-INF/applicationContext-ibatis.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="classpath:properties/jdbc.properties" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
p:username="${jdbc.username}" p:password="${jdbc.password}" />
<!-- Transaction manager for iBATIS Daos -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation"
value="classpath:springapp/dao/SqlMapConfig.xml" />
</bean>
<!-- Add additional Dao definitions here -->
<bean id="productDao"
class="springapp.dao.ProductDaoImpl">
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
</beans>
jdbc.properties파일은 properties라는 package를 만들고, jdbc.properties파일을 넣어버립시다.
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://DB주소
jdbc.username=DB아이디
jdbc.password=DB비밀번호
이 설정들의 bean들의 관계를 보고 싶다면-_-;
Spring Elements에서 오른쪽버튼 클릭하고 properties를 선택.
Bean Support를 선택, Add한 뒤 두개의 설정파일(applicationContext.xml, applicationContext-ibatis.xml)선택.
Config set에서 New하고 Name에 applicationContext라고 하고, 두개다 체크 오케이~
그럼 이제 스프링 설정파일에서 에러를 찾아낼 수 있어요!
bean들의 관계를 그래프로도 볼 수 있네요!
Config set에 추가한 applicationContext에다가 마우스오른쪽버튼을 클릭하면 open graph로 볼 수 있어요!
이제 클라이언트 구현으로....다음 시간에-_-;
[FLEX3] 스프링프레임워크(SpringFramework)와 플렉스(BlazeDS)를 연동한 간단예제2 - 서버단구현1
`id` int(11) NOT NULL,
설정파일은 applicationContext.xml과 applicationContext-ibatis.xml 두개를 사용할껍니다.
Java Resources:src에다가 New를 하고 class를 선택합니다.
package는 springapp.domain이라고 하구요.
Name은 Product라고 하고 Finish
package springapp.domain;
public class Product {
private int id;
private String description;
private Double price;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
}
Java Resource:src에 New해서 interface를 추가합시다.
package에다가 springapp.dao라고 써놓고,
Name에다가 ProductDao라고 씁시다.
package springapp.dao;
import java.util.List;
import springapp.domain.Product;
public interface ProductDao {
public List<Product> getProductList();
}
저 Dao인터페이스를 구현해봅시다!!!
package springapp.dao;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import springapp.domain.Product;
public class ProductDaoImpl extends SqlMapClientDaoSupport implements
ProductDao {
protected final Log logger = LogFactory.getLog(getClass());
@SuppressWarnings("unchecked")
@Override
public List<Product> getProductList() {
logger.info("Getting products!");
return getSqlMapClientTemplate().queryForList("getProductList");
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<typeAlias alias="Product" type="springapp.domain.Product"/>
<sqlMap resource="springapp/dao/MySQLProduct.xml" />
</sqlMapConfig>
alias지정해주고, resource는 src/springapp/dao/MySQLProduct.xml파일입니다.
MySQLProduct.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="Product">
<resultMap id="ProductMap" class="Product">
<result property="id" column="id" />
<result property="description" column="description" />
<result property="price" column="price" />
</resultMap>
<select id="getProductList" resultMap="ProductMap">
select id, description, price from products
</select>
</sqlMap>
getProductList라는 것은 products테이블에서 내용을 select하는 것이네요.
Dao가 완성되었네요! 너무 길어지니 다음이시간에 ...