Mayaa에서는 JSP태그를 그대로 사용할 수 있다.
JSTL core의 out태그 사용 예hello_jstl.html와 hello_jstl.mayaa를 아래와 같이 작성한다.
hello_jstl.html
<html>
<body>
<span id="message">dummy message</span>
</body>
</html>
hello_jstl.mayaa
<?xml version="1.0" encoding="UTF-8"?>
<m:mayaa xmlns:m="http://mayaa.seasar.org"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<c:out m:id="message" value="Hello Mayaa!" />
</m:mayaa>
실행결과:
<html>
<body>
Hello Mayaa!
</body>
</html>
m:write와 동일한 결과를 낸다.
HTML태그 유지하기<?xml version="1.0" encoding="UTF-8"?>
<m:mayaa xmlns:m="http://mayaa.seasar.org"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<c:out m:id="message" value="Hello Mayaa!" m:replace="false" />
</m:mayaa>
m:replace를 false로 함으로써 HTML를 유지할 수 있다.
실행결과:
<html>
<body>
<span id="message">Hello Mayaa!</span>
</body>
</html>
스크립트 사용 <c:out m:id="message" value="${ 1 + 2 }" />
와 같이 스크립트도 그대로 사용가능하다.
|