Weitere ähnliche Inhalte Ähnlich wie Daejeon IT Developer Conference Web Service Practice (20) Kürzlich hochgeladen (20) Daejeon IT Developer Conference Web Service Practice1. 본 문서의 배포 및 변경 , 출력 및 활용에 관한 모든 권리는 작성자에 있습니다 . 본 서비스는 제 1 회 대전 IT 개발자 커뮤니티 참석자를 위해 제공됩니다 . 2. 웹 서비스 개발 실습 심익찬 대전개발자커뮤니티 September 28 th , 2008 7. Web Develope Environment 프로젝트 소스 폴더 Xxx.hbm.xml hbm vo community net src project XxxService.java service community net src project IXxxService.java iface service community net src project XxxHibernateDao.java XxxIbatisDao.java persistence community net src project IXxxDao.java iface persistence community net src project ActionXxx.java action community net src project HibernateSessionFactory.java hibernate common community net src project Struts2Dispatcher.java filter common community net src project hibernate.cfg.xml struts.xml struts.properties message.properties project web.xml WEB-INF WebContent project Xxx.java vo community net src project Step 5 Step 4 Step 3 Step 2 Step 7 Step 6 Step 1 10. Practical <filter> <filter-name>struts2</filter-name> <filter-class> type.company.common.filter.Struts2Dispatcher </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> web.xml 11. Practical <?xml version= '1.0' encoding= 'utf-8' ?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- <property name="connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="connection.url"> jdbc:mysql://localhost:3306/community </property> <property name="connection.username"> root </property> <property name="connection.password"> mysql </property> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> --> hibernate.cfg.xml 12. Practical <property name= "hibernate.connection.datasource" > java:/comp/env/jdbc/community </property> <property name= "hibernate.show_sql" > true </property> <property name= "hibernate.format_sql" > true </property> <property name= "connection.useUnicode" > true </property> <property name= "connection.characterEncoding" > utf8 </property> <property name= "current_session_context_class" > thread </property> <property name= "hibernate.transaction.factory_class" > org.hibernate.transaction.JDBCTransactionFactory </property> <mapping resource= " type/company/vo/hbm/User.hbm.xml " /> </session-factory> </hibernate-configuration> 정보 : Starting Servlet Engine: Apache Tomcat/6.0.16 AbandonedObjectPool is used (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@14d1d41) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 hibernate.cfg.xml 13. Practical <?xml version= "1.0" encoding= "UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name= " struts2 " extends= " struts-default " > </package> </struts> struts.xml 23. Before & After <action name= "ucualcrf" method= "ucualcrf“ class= "type.company.action.uc.ua.UcualcAction" > <result name= "success" > /uc/ua/lc/ucualcrf.jsp</ result> </action> <action name= "ucualcrs" method= "ucualcrs" class= "type.company.action.uc.ua.UcualcAction" > <result name= "success "> /uc/ua/lc/ucualcr.jsp </result> <result name= "input "> /uc/ua/lc/ucualcrf.jsp </result> </action> <action name= "ucujucc" method= "ucujucc" class= "type.company.action.uc.uj.UcujucAction" > <result name= "success" type= "redirect-action" > ucujusrList </result> <result name= "input" type= "chain" > ucujuccf </result> </action> <action name= "ucujucr" method= "ucujucr" class= "type.company.action.uc.uj.UcujucAction" > <result name= "success ">/uc/uj/uc/ucujucr.jsp </result> </action> struts.xml