Google Sitebricks
JavaOneã§Googleã®æ°ããWebãã¬ã¼ã ã¯ã¼ã¯ãçºè¡¨ãããã¿ããã§ããã
ãã®åãSitebricksãGWTãã¼ã¹ã®ããã§ãã
ã¾ãã¯è¦ã¦ã¿ã¦ãã ãããJavaOneè³æããæç²ã
POJOã³ã¼ãã
class MyPage { @Property String meaning = â17â; }
ãã³ãã¬ã¼ãã¯ãã¡ãã
<body> The meaning of life is: ${meaning} </body>
Pageã¨URLããããã³ã°ãã¦ããã®ããããã£ãJSPã®ELã§ãããã³ã°ã¨ãã£ãã¨ããã
ã¨ã¾ãããã¾ã§ã¯ã¾ãæ®éã
ã¨ããããä¾ãã°ä»¥ä¸ã®ãããªtypoãããã¨ãã³ã³ãã¤ã«ã¨ã©ã¼ã«ãªãã¾ãã
ã©ãããã³ã³ãã¤ã«æã«ãã§ãã¯ããã¿ããã§ããã
åã®ä¸ä¸è´ã¨ãããã§ãã¯ããã¿ããã
class MyPage { //typoãã¦ããï¼ @Property String meening = â17â; }
ãã¨ãSitebricksãURLã¨Pageããããã³ã°ãããããªã®ã§ã
ããã¯ãããªã¨æã£ãã®ããåURLã«å¯¾å¿ããPageããªãå ´åã
ã³ã³ãã¤ã«ã¨ã©ã¼ã«ãªãããã§ãã以ä¸ã®ãããªã±ã¼ã¹ã§ãã
<body> <a href=â/non_existent_uriâ>Bad Link</a> <form action=â/misspelled_uriâ> ... </body>
JAX-RSã®ãããªã¢ããã¼ã·ã§ã³ãããã®ã§ãHTTPã®ã¡ã½ãããã¨ã«ã¢ã¯ã»ã¹ãå¯è½ã§ãã
以ä¸ã®Pageã ã¨ã/artists/Hogeã£ã¦URLã§ãHTTPã®GETã ã¨ãgetã¡ã½ãããå¼ã°ããã¿ãã
@At(â/artists/:nameâ) class MyPage { @Get void get(@Named(ânameâ) String name) { .. } }
å¾ã
ã«ãããã¸ãããè³å¦ä¸¡è«ããããããªãã¢ã¤æãã«ãªãã¾ãw
以ä¸ã®ããã«ãã³ãã¬ã¼ãã®ã»ãã«ã¢ããã¼ã·ã§ã³ãã¤ãããã¨ãåºæ¥ã¾ãã
ãã®çºæ³ã¯ãªãã£ããªãw
ãã®ä¾ã ã¨ãMyPage#getShould()ãtrueãè¿ãå ´åã«ã®ã¿ã$meaningé¨åã表示ããã模æ§ã
<body> The meaning of life is: @ShowIf(should) <span>${meaning}</span> </body>
POJOã³ã¼ãã
class MyPage { boolean getShould() { return name.equals(âZaphod Beeblebroxâ); } ... }
ãã¨ã¯widgetãã¢ããã¼ã·ã§ã³ã«ãã£ã¦æ®éã®htmlã«å·®ãè¾¼ããã¿ããã§ã
以ä¸ã®ãããªä¾ã ã¨ãSuggestBoxWidgetãå·®ãè¾¼ããã¨ãåºæ¥ãã¿ããã
ããã¯ã¾ã ããã ãã ã¨ããããªãã§ããã
<head> @Require <script src=âgwt_suggest.jsâ></script> ... <body> <input type=âtextboxâ name=âsuggestâ/> </body>
POJOã³ã¼ãã
@EmbedAs(âSuggestâ) class SuggestBoxWidget { ... }
ã¨ããããã§ãSitebricksã¯ãããªãã¬ã¼ã ã¯ã¼ã¯ã®ããã§ãã
- RESTfulãªæã
- HTTPãã¨ã«ã¡ã½ãããåãã
- ã³ã³ãã¤ã«ã¿ã¤ã ã½ãªã¥ã¼ã·ã§ã³ã§ãã³ãã¬ã¼ãã¨Pageãçµã³ã¤ãã
- ã©ãããGuice Servletã¢ã¸ã¥ã¼ã«ã¨GWTãã¼ã¹
- Webã¹ã³ã¼ããã«ã³ãã»ã¼ã·ã§ã³ã¹ã³ã¼ãå®å
- Cometã®ãµãã¼ã(Waveé£æºã¨ãwidgetã¨ãããããã®èãã¦ãã®ããª)
- ãããããç®è¦ãï¼
ãã ãããããªãã¨ãããããã¶ã¤ãã«ãã³ãã¬ã¼ãã«æ¸ããã¢ããã¼ã·ã§ã³ã¨ãæ¶ãããã ããJKã¨
ã¨ãã ã©å
çããã£ããã£ã¦ã¾ããããç®è¦ãããããåå¼·ä¼ã§ã§ãçºè¡¨ãã¦ã¿ããã¨æãã¾ãã