How to use JSP tags defined in a freemarker template available in the final rendered page
quophyie <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hi All
I am having a few problems with importing jsp tags into my freemarker
templates and i was hoping someone could help.
The problem is this. I have a freemarker file which defines a few jsp
taglibs which I would like imported into all my jsp files. My jsp tags are
defined in a file called jspTags.flt as defined below
jspTags.ftl
<#assign c=JspTaglibs["http://java.sun.com/jsp/jstl/core"]>
<#assign fmt=JspTaglibs["http://java.sun.com/jsp/jstl/fmt"]>
<#assign form=JspTaglibs["http://www.springframework.org/tags/form"]>
I have then defined my freemarker template as follows
freemarkerTemplate.ftl
<#include "jspTags.ftl">
<html>
<head>
<title>My Site - {title}</title>
</head>
<body bgcolor="#FFFFFF">
<h1>My freemarker template </h1>
{body}
</body>
</html>
Now I want to apply the template to a JSP page as defined below
login.jsp
<html>
<head>
<title>Login</title>
</head>
<body bgcolor="#FFFFFF">
<@form.form action="loginAction.jsp" method="POST">
<table border="1">
<tr>
<td>
My Login Page!!!
</td>
</tr>
</table>
</@form.form>
</body>
</html>
However, I when I try and access the page (login.jsp), I get an error like
Expression form is undefined on line 14, column 3 in view/login.jsp.
The problematic instruction:
----------
==> user-directive form.form [on line 14, column 1 in view/login.jsp]
So my question is, If I have my jsp tags defined in one file(jspTags.ftl)
and include it my template(freemarkerTemplate.ftl), how do I make the
jsp tags available in the view(login.jsp) that the template is being applied
to.
Any help will be very much appreciated.
Thanks
--
View this message in context: http://old.nabble.com/How-to-use-JSP--tags-defined-in-a-freemarker-template--available-in-the-final-rendered-page-tp26407274p26407274.html
Sent from the freemarker-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july