Equivalent of jsp:useBean in FTL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Equivalent of jsp:useBean in FTL

iogbole
Hello,

I'm a newbie in FTL and I was wondering if it's possible to use javabean in FTL like it's done in JSP:

For example: Given this JavaBean:

public class FTLquestion {

public String sayHello(){
return "Hello"
}
}


In JSP,  I will call this bean like:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<jsp:useBean id="ftlq" class="com.ftl.helloworld.FTLquestion" scope="request"/>
<HTML>
....
${ftlq.sayHello}
....
</HTML>


So my question is it possible to create javabean handler in Freemarker as demonstrate with JSP above? Please suggest/help