Advent Calendarã«åå ãã¦ã¿ããã¦ããã°ãå§ãã¦ã¿ã¾ããï¼ãããããé¡ããã¾ãï¼ ãã¡ãã¯Java EE Advent Calendar 2013 - Adventar 20æ¥ç®ã®è¨äºã§ãã åæ¥ã®è¨äºã¯AOE Takashiããã®ã Java EE Managed Beanã«ã¤ã㦠(Java EE Advent Calendar2013 19æ¥ç®) - AOEã®æ¥è¨ ãã§ããã æ¬æ¥ã¯Java EEã¨ä½µç¨ãããã³ãã¬ã¼ãã¨ãã¦ããã°ãã°è©±é¡ã«ãããThymeleafã«ã¤ãã¦æãã¨ãããæ¸ãã¾ããã Thymeleafãã°ããã æ¥åã§ã¯JSPãå©ç¨ãã¦ããã®ã§ããã以åãä¸è¨ã®è¨äºã«è§¦çºããã¦ããThymeleafãåãå ¥ãããã¨ç»çãã¦ãã¾ããï¼ãã¾ã ããã¼æ´»åãå®ã£ã¦ãã¾ãããã»ã»ã»ãï¼ ãã¶ã¤ãã¼ãããã¡ã¨ã®åæ¥ãæ¨ãé²ãã Thymeleaf | Nulab Te
ãEclipseã«ã¤ã³ã¹ãã¼ã«ããSpring Test Suiteã§SpringMVCããã¸ã§ã¯ããä½æãããã§ã¯ãSTSã使ç¨ãã¦SpringMVCã®ãµã³ãã«ããã¸ã§ã¯ããä½æããã ãµã³ãã«ããã¸ã§ã¯ãã®Viewã¯JSPã«ãããã®ã ããä»åã¯Viewã®ãã¼ã¿ãã¤ã³ãé¨åã«ãã³ãã¬ã¼ãã¨ã³ã¸ã³ã§ããthymeleafãå°å ¥ããã ï¼ï¼pom.xmlã«thymeleafã追å ãã thymeleafã®ãã¼ã¸ããMaven infoãåç §ãã¦è¿½å ããã <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring3</artifactId> <version>2.1.2.RELEASE</version> </dependency> ï¼ï¼servlet-context.xmlã§Springãã³ãã¬ã¼ãã¨
HOMEJava EESpring Tool Suite 㧠Spring MVC ãã JPA(Java Persistence API) ãå©ç¨ãã Spring Tool Suite ã® Spring MVC Project ãã³ãã¬ã¼ããããSpring JDBC ã使ããããã«ãã¦ãJDBC ã JNDI çµç±ã§ä½¿ããããã«ãä¸æ©ä¸æ©è©¦ãã¦ãã¦ããããã JPAã試ãæºåãã¨ã¨ã®ã£ãã Spring MVC Project ãä½æããJDBCãJNDI ãã使ç¨ã§ããç¶æ ã«ããããã¸ã§ã¯ã ã«å¯¾ãã¦ãSimple Spring JPA Utility Project ã§ä½æããããJPAã®ãµã³ãã«ã³ã¼ãã移æ¤ãã¦ã¿ãã EclipseLink ããã³ä¾åã©ã¤ãã©ãªã®è¨å® JPA ã®ã¨ã³ã¸ã³ã¨ãã¦ãEclipseLink ã使ç¨ããããã®è¨å®ã Maven ã® pom.xml ã«è¡
ãããããJavaã¨ã³ã¸ãã¢ãªã®ã§ãjava8ãä¸å¿è§¦ã£ã¦ãããªãããªã¨æãã ãã¨ããã¬ã¼ã ã¯ã¼ã¯ã®Springã4ç³»ãåºãã®ã§ä¸å¿è§¦ã£ã¦ãããªãããªã¨æãã åã«ããã¨ãSpringBootã¨ãããã¤ã使ãã°æ¥½ã«éçºã§ããã¨èããæè¿ã¯Thymeleafã¨ãããã³ãã¬ã¼ãã¨ã³ã¸ã³ãã¤ã±ã¦ãã¨èãããããªããããããã£ã¦è©¦ãã¦ã¿ã¾ããã Java8 ãªããã©ã ãå¼ã使ããããã«ãªã£ãã¨ãStreamãè¯ãæãã¨ãèãã¾ããã ããããJDKã¨JREãå ¥æã Spring4 java8ã«å¯¾å¿ããããWebSocketã«å¯¾å¿ããããããããé²åãããããã ããããSpring Tool Suite(Springãæåããå ¥ã£ãEclipse)ãå ¥æããã¼ã¸ã§ã³ã¯3.5ç³»ããã SpringBoot Springã®åã©ã¤ãã©ãªï¼aopã ã¨ãcontextã ã¨ãï¼ãã²ã¨ã¾ã¨ãã«ãã¦ããããã®ã
è¨äºç®æ¬¡ ãSpring 4.0.5対å¿ãSpring Boot 㨠Spring MVC 㨠Spring Data JPA ã使ã£ã¦ Web API ãä½æãã (1) ãSpring 4.0.5対å¿ãSpring Boot 㨠Spring MVC 㨠Spring Data JPA ã使ã£ã¦ Web API ãä½æãã (2) ãSpring 4.0.5対å¿ãSpring Boot 㨠Spring MVC 㨠Spring Data JPA ã使ã£ã¦ Web API ãä½æãã (3) ä»å使ç¨ããã½ã¼ã¹ https://github.com/nnasaki/spring-rest/tree/1 1åç®ã®ç¶ãã§ãããããªæãã®ãã¤ããã¾ãã ã©ããªåãããããè¦ã¦ã¿ãã ã½ã¼ã¹ã¯ Github ã«ç½®ãã¾ããããã½ã¼ã¹ãè½ã¨ãã¦ãã¦ã ./gradlew bootRun ããã°æ¬¡ã®
DIï¼Dependency Injectionï¼ã¯ããæ©è½ãé¨ååããè¨å®ãã¡ã¤ã«ã§é¨åéã®é¢ä¿ãè¨å®ãããã¨ã§ã¢ããªãä½æãããã¨ãã§ããæ©è½ãã§ãã
Spring MVCã§ããã©ã¼ã Bean*1ãã»ãã·ã§ã³ã¹ã³ã¼ãã«æ ¼ç´ãã¦å¦çããããå ´åã以ä¸ã®ããã«@SessionAttributesã¢ããã¼ã·ã§ã³ãã³ã³ããã¼ã©ã¼ã¯ã©ã¹ã«ä»å ãããã¨ã§è¡ããã¨ãã§ãã¾ããã¾ããå¦çã®å®äºæã«ã¯ SessionStatusããã©ã¡ã¼ã¿ã¼ã§åãåããsetComplete()ã¡ã½ãããå¼ã³åºããã¨ã§ã»ãã·ã§ã³ä¸ã®ãã©ã¼ã ãåé¤ãã¾ãã @Controller @RequestMapping(value="/account") @SessionAttributes("account") public class AccountController { private Map<Long, Account> accounts = new ConcurrentHashMap<Long, Account>(); @RequestMapping(method=Re
ãã®åã®ã¨ããJavaBeansã®çºã®Validationã®ä»æ§ã§ããJSR303ã§ãããè¿é ã§ããªãã§ããHibernateã¯ãã¡ããããã®ä»SpringãOvalãªã©ã®å¨è¾ºãã¬ã¼ã ã¯ã¼ã¯ã®å¯¾å¿ãé²ãã§ããã¶ã使ãããããªã£ã¦ãã¾ããã ã¨ããã§ã¢ããªã±ã¼ã·ã§ã³ä½ã£ã¦ã¦Validationã®ä»çµã¿ã£ã¦æ¯åæ©ã¿ã¾ãããï¼ç§ãJavaã§Webã¢ããªã±ã¼ã·ã§ã³ã¤ããã¯ãããé ãªããã ã¨Struts1.xãå ¨çæã§validation.xmlãvalidation-rule.xmlã¨ã使ã£ã¦æ¸ãã¦ã¾ããã(ä»èããã°äºåº¦ã¨ãããããªãã§ããï½)ãä»ã§ãæ¯åã©ã®ãã§ãã¯ãã©ã®ã¬ã¤ã¤(ã¢ããªã±ã¼ã·ã§ã³ã¬ã¤ã¤ï¼ãã¡ã¤ã³ã¬ã¤ã¤ï¼)ã«æããããã¨ãããã¼ã¿ã¹ãã¢ã«åãåããããªãã¨ãããªãValidationã£ã¦ç»é¢ã®å ¥åã ãã§ãã§ãã¯ã§ããã®ã¨ã©ã管çãããããªã¨ããè²ã ã¨æ©ããã¨ããã°ãã°ã§ããæè¿D
ååã®ç¶ãã§ããååã¯Tiles3ã®é©ç¨ãè¡ãã¾ãããä»åã¯JSONã«ãããã¼ã¿ã®ããåããè¡ãã¾ãã ããããã㨠ãã©ã¦ã¶ã®ãã©ã¼ã ã«å ¥åããæ å ±ãJSONãã¼ã¿ã¨ãã¦ãµã¼ãå´ã¸éä¿¡ãããµã¼ãå´ã§ã¯åãåã£ãJSONãåºã«æ å ±ãä»å ããJSONãã¼ã¿ãä½æã»åºåãã¾ãããã©ã¦ã¶ã§ã¯åãåã£ãJSONãã¼ã¿ãç»é¢ã«è¡¨ç¤ºãã¾ãã ã³ã³ããã¼ã© ã¾ãã¯JSONãåãåãã³ã³ããã¼ã©ããã package jp.co.shantery.tutorial.web.json.controller; import jp.co.shantery.tutorial.dto.JsonResponseDto; import jp.co.shantery.tutorial.web.json.command.JsonCommand; import org.apache.log4j.Logger; import
Spring Batchã¨ã¯ ä»åç´¹ä»ããSpring Batchã¯ãã¨ã³ã¿ã¼ãã©ã¤ãºã¬ãã«ã®ãããå¦çãå®ç¾ããããã®ãã¬ã¼ã ã¯ã¼ã¯ã ã ã¨ã³ã¿ã¼ãã©ã¤ãºã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ã大éã®ãã©ã³ã¶ã¯ã·ã§ã³ãä¸æ¬å¦çããããããå¦çãã¯é¿ãã¦éããªããSpring Batchã§ã¯ãéçºè ãããããå¦çããç°¡åã«å®è£ ããããã主ã«ä»¥ä¸ã®ãããªæ©è½ãæä¾ãã¦ããã ã¹ã±ã¼ã©ããªã㣠- ãã«ãã¹ã¬ããã»ãã«ãããã»ã¹ã§ã®ä¸¦åå¦ç ãã¼ã¿ã®æ´åæ§ãä¿ã¡ãå¦çé åºãä¿éããããããããã»ã¹ç®¡çã ãããããã»ã¹ã®ãã©ã³ã¶ã¯ã·ã§ã³ç®¡ç ãããå¦çã§å¿ è¦ãªåºæ¬çãªæ©è½ã¯Spring Batchãã¬ã¼ã ã¯ã¼ã¯ã«ä»»ããéçºè ã¯ãã¸ãã¹ãã¸ãã¯ã®å®è£ ã«æ³¨åãããã¨ãã§ããã 次ã«Spring Batchã®ã¢ã¸ã¥ã¼ã«æ§æãç´¹ä»ãããã大ã¾ãã«2ã¤ã®ã¢ã¸ã¥ã¼ã«ã«åããã¦ããã Infrastructure(åºç¤æ©
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}