모든 페이지에 설정을 공통으로 하고 싶은 경우 /default.mayaa라는 파일에 기술한다. 아래의 예에서는 currentTime에 대한 설정을 매 페이지에 하지 않고 default.mayaa파일을 통해서 기술한 예이다. hello_with_time.html <html> <body> <span id="currentTime">dummy time</span> <br> <span id="message">dummy message</span> </body> </html> hello_with_time.mayaa <?xml version="1.0" encoding="UTF-8"?> <m:mayaa xmlns:m="http://mayaa.seasar.org"> <m:write m:id="message" value="Hello Mayaa!" /> </m:mayaa> default.mayaa <?xml version="1.0" encoding="UTF-8"?> <m:mayaa xmlns:m="http://mayaa.seasar.org"> <m:write m:id="currentTime" value="${ new java.util.Date().toString() }" /> </m:mayaa> 실행결과 <html> <body> Thu Oct 20 20:01:38 JST 2005 <br> Hello Mayaa! </body> </html> 설정 덮어쓰기 위의 예에서 hello_with_time.mayaa파일에 currentTime의 설정을 기술하면 default.mayaa의 설정을 덮어쓰기를 하게된다. |
마야 (Mayaa) 템플릿 엔진 >