Faceletsã§ã«ã¹ã¿ã ããªãã¼ã¿ã使ã
ãä»äºã§ãã¥ã¼å±¤ã«Faceletsã使ã£ã¦ã¦ãï¼JSFå®è£
ã¯MyFacesï¼
JSFã®æ¨æºããªãã¼ã¿ãå¦ä½ããéãã¦ãªããã§ããã£ã±ãå®è£
ããå¿
è¦ãçºçã
ã§ããã ã®ããªãã¼ã¿ãªããããªæãã§ãããã ãã©â¦ã
ãã©ã¡ã¼ã¿ã使ãã¨ãªãã¨ãã¿ã°ã©ã¤ãã©ãªãã¤ãããªãããã¨ã
ãããªãã¨ãTagã¯ã©ã¹ã«TLDãã¡ã¤ã«ãå¿
è¦ã«ã
ã ãã©Faceletsã使ã£ã¦ããã°ãTagã¯ã©ã¹ãä½ã£ããããªãã¦ãããªãã¼ã¿ãå¼ã¹ãã¹ããä»æ§ï½
æé ã¨ãã¦ã¯ãtaglib.xmlãã¡ã¤ã«ãä½æâFaceletsã§ãã¼ãâç»é¢ã«å®ç¾©ã
ããã ãã
ãã£ã¦ã¿ãã¨ããããæå¤ã«ä¾¿å©ä¾¿å©ã
ã¡ãªã¿ã«ããªãã¼ã¿ã¯JSFã§ç¨æããã¦ãValidatorã®ãµãã¯ã©ã¹ã§OKã
ä½ã£ãããªãã¼ã¿ã¯faces-config.xmlã«è¿½å ãã¦ããã
[/WEB-INF/validator.taglib.xml]http://d.hatena.ne.jp/gsh-kz numericValidator numericValidator
namespaceã¿ã°ã§å®ç¾©ããåå空éã§ç»é¢ã§ä½¿ç¨ããã¿ã°(xmlns)ã«ã
tagã¿ã°ã§å²ãã ä¸ã«ããªãã¼ã¿ã宣è¨ã
validator-idã¯faces-config.xmlã«å®£è¨ãã¦ããIDã
ä½æããtaglib.xmlãFaceletsããã¼ãããã«ã¯ãweb.xmlã«ä»¥ä¸ã追å ã
[/WEB-INF/web.xml]facelets.LIBRARIES /WEB-INF/validator.taglib.xml
ããã§èµ·åæã«Faceletsãæå®ãããã¹ãããã¼ãããã¨ã
ãã¨ã¯ä½¿ãããç»é¢(*.xhtml)ã§
ã¦ãããã
ããã ã¨ãã©ã¡ã¼ã¿(ä¾ã ã¨maxLength)ã使ãããã¨ã便å©ã
ãã©ã¡ã¼ã¿ã使ã£ãããªãã¼ã¿ã®ä½ãæ¹ã¯çç¥ã
ã¤ãããã©ã¡ã¼ã¿ã®ã»ãã¿ãç¨æãã¦faces-config.xmlã«ããã½ãã¿ã°è¿½å ããã ãã ãã©^^;
ããããã©ã¡ã¼ã¿ã®ä¿æ復å
ã«ã¯ã¾ã£ãã®ã¯å
ç·ï½