ã¯ããã«
ãããããGrailsã使ã£ã¦ã¿ããã¨ã«ãã¾ããããGrailsã¯ã³ãã³ãã使ã£ã¦ã¢ããªã±ã¼ã·ã§ã³ã®éª¨æ ¼ãä½ã£ã¦ããã¾ããåºæ¬çãªã³ãã³ãã®å½¹å²ã¨ãããã¦çæãããããã°ã©ã ãã¡ã¤ã«é¡ãããããGrailsã®ã¢ããªã±ã¼ã·ã§ã³ã§ã©ã®ãããªå½¹å²ãæããã¦ããããã¨ãã£ãåºæ¬çãªäºæã«ã¤ãã¦èª¬æããã¦ããã¾ãããã
対象èªè
- JSPãæ¸ãã®ã¯æ£ç´ããã©ã……ã¨è¿é æãã人ã
- Ruby on Railsã¹ã¿ã¤ã«ã®éçºã«èå³ãããã¨ãã人ã
- MVCãã¬ã¼ã ã¯ã¼ã¯ãJavaã§å¦ã³ãããã¨ãã人ã
Grailsã®å ¥æã¨ã¤ã³ã¹ãã¼ã«
ãGrailsã®è¨è¿°è¨èªãGroovyãã®åºæ¬çãªä½¿ãæ¹ã«ã¤ãã¦ã¯åå大ä½é ã«å ¥ãããã¨ãã§ãã¾ãããä»åã¯ãããããGrailsã«ææ¦ãã¦ã¿ã¾ããããã¾ãã¯Grailsãå ¥æãã¾ããGrailsã®Webãµã¤ããããã¦ã³ãã¼ããããã¨ãã§ãã¾ãã
ãæ¬ç¨¿å·çæç¹ã§ã¯ã1.1ãææ°çã¨ãªã£ã¦ãã¾ããé å¸å½¢å¼ã¯å§ç¸®ãã¡ã¤ã«ã«ãªã£ã¦ãã¾ããzipã¨tar/gzã®2ã¤ï¼ãããããã¤ããªã¨ã½ã¼ã¹ï¼ãã¢ãããã¼ãããã¦ãã¾ãã®ã§ãWindowsã¦ã¼ã¶ã¼ã§ããã°zipã®ãã¤ããªãã¡ã¤ã«ããã¦ã³ãã¼ãããã°ããã§ãããã
ããã¦ã³ãã¼ãããå§ç¸®ãã¡ã¤ã«ãå±éããã¨ããgrails-1.1ãã¨ãããã©ã«ããä½æãããããã«Grailsã®ãã¡ã¤ã«ãä¿åããã¾ãããã®ãã©ã«ãããã¼ããã£ã¹ã¯ã®é©å½ãªå ´æã«é ç½®ããã¾ããããã§ã¯ãã©ã«ãåããGrailsãã¨å¤æ´ããCãã©ã¤ãç´ä¸ã«é ç½®ãããã¨ã«ãã¾ãï¼ã¤ã¾ããã©ã«ãã®ãã¹ã¯C:\Grailsã¨ãªãã¾ãï¼ã
ãç¶ãã¦ãç°å¢å¤æ°ã追å ãã¾ããã·ã¹ãã ã®ç°å¢å¤æ°ã«ãæ°ãã«ãGRAILS_HOMEãã¨ããå¤æ°ãä½æããããã«Grailsã®ãã¹ï¼ããã§ã¯C:\Grailsï¼ãå¤ã¨ãã¦è¨å®ãã¦ãã ãããããã¦ãPATHã·ã¹ãã ç°å¢å¤æ°ã«ãã%GRAILS_HOME%\binããã»ãã³ãã³ã§åºåã£ã¦è¿½å ãã¾ãï¼æ¢åã®å¤ãæ¶ããªãããã«æ³¨æãã¦ãã ããï¼ãGrailsã®ã¤ã³ã¹ãã¼ã«ã¯ããã£ãããã ãã§ãã
ã¢ããªã±ã¼ã·ã§ã³ãä½æãã
ãã§ã¯ãé£ãããã¨ã¯å¾åãã«ãã¦ãã¨ãããGrailsã§Webã¢ããªã±ã¼ã·ã§ã³ãä½ã£ã¦ã¿ããã¨ã«ãã¾ããããGrailsã¯ãã³ãã³ãããã³ããããå®è¡ããã³ãã³ãã使ã£ã¦åºæ¬çãªããã°ã©ã ã®ä½æãè¡ãã¾ããã¾ãæåã«ä½æããã®ã¯ããã¢ããªã±ã¼ã·ã§ã³ãã§ããããã¯Grailsã®ããã°ã©ã ã®æãåºæ¬ã¨ãªãåä½ã§ããGrailsã§éçºãè¡ãéã«ã¯ãã¾ããã®ã¢ããªã±ã¼ã·ã§ã³ãä½æããããã«ãã¾ãã¾ãªãã¡ã¤ã«é¡ã追å ãããã¨ããæµãã«ãªãã¾ãã
ãã§ã¯ãã¾ãã¦ã¼ã¶ã¼ã®ãã¼ã ãã£ã¬ã¯ããªã«ãgrails_appsãã¨ãããã©ã«ããä½æãã¦ãã ããããã®ãã©ã«ãã®ä¸ã«ãGrailsã®ã¢ããªã±ã¼ã·ã§ã³ãä½æãã¦ãããã¨ã«ãã¾ãããããã©ã«ããç¨æããããã³ãã³ãããã³ãããèµ·åãã¦ãã ãããããã¦ãcdã³ãã³ãã§ãã®grails_appsãã£ã¬ã¯ããªã«ç§»åãã次ã®ããã«ã³ãã³ããå®è¡ãã¾ãã
grails create-app gapp
ãããã¯ããgappãã¨ããã¢ããªã±ã¼ã·ã§ã³ãä½æãããã®ã§ããGrailsã§Webã¢ããªã±ã¼ã·ã§ã³ãä½æããå ´åã«ã¯ãã¾ãWebã¢ããªã±ã¼ã·ã§ã³ãä½æããå ´æã«ã«ã¬ã³ããã£ã¬ã¯ããªã移åãããgrails create-app ã¢ããªã±ã¼ã·ã§ã³åãã¨ã³ãã³ããå®è¡ãã¾ããããã§ããã®å ´æã«Webã¢ããªã±ã¼ã·ã§ã³ã®ããã°ã©ã é¡ãä½æããã¾ãããªããæå¾ã«ãhibernateãã¢ããã°ã¬ã¼ãããããã¨ãããã¦ããå ´åãããã¾ãããã®å ´åã¯ãã®ã¾ã¾ãyããå ¥åãã¦ãã ããã
ãã³ãã³ãå®è¡å¾ããgrails_appsããã©ã«ãã®ä¸ãè¦ã¦ã¿ã¾ãããããgappãã¨ãããã©ã«ããä½æããã¦ããã¯ãã§ããããããWebã¢ããªã±ã¼ã·ã§ã³ã®ãã©ã«ãã§ãããã®ä¸ã«ãã¢ããªã±ã¼ã·ã§ã³ã«å¿ è¦ãªãã¡ã¤ã«é¡ããã¹ã¦ä¿åããã¦ãã¾ãã