Quantcast

Supporting JSTL functions as well in FreemarkerServlet?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Supporting JSTL functions as well in FreemarkerServlet?

Woonsan Ko
Hi,

We found that FreemarkerServlet doesn't support JSTL functions.
I know there are workaround solutions like [1], but it would be more
seamless, IMHO, if it cares JSTL functions as well.
Would it be a good improvement to support JSTL functions in the core?

I also browsed the source and TaglibFactory.java doesn't care "function"
element at the moment. So I'm thinking that maybe we can improve it to
add functor-like model object into the TaglibFactory.Taglib.tags map
*somehow*.
We're also interested in helping or contributing to improve this. Any
suggestions or hints are more than welcome!

By the way, we Hippo have used Freemarker as the default templating
engine in our Web CMS products [2]. I really appreciate for this great
library and your effort.

Thanks!

Kind regards,

Woonsan

[1]
http://stackoverflow.com/questions/25123031/convert-jstl-function-to-freemarker
[2]
http://www.onehippo.org/library/concepts/web-application/hst-freemarker-support.html

--
[hidden email]     www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Supporting JSTL functions as well in FreemarkerServlet?

Daniel Dekany
Hi,

Are JSTL functions always just plain static methods, or do some of
them have some additional requirements? Because if they are just
static methods, then FreeMarker could certainly easily support them.
It should be implemented inside freemarker.ext.jsp. Contributions that
keep backward compatibility are highly welcome (will need to sign a
typical Contributor License Agreement)!

--
Thanks,
 Daniel Dekany


Friday, August 8, 2014, 6:27:15 PM, Woonsan Ko wrote:

> Hi,
>
> We found that FreemarkerServlet doesn't support JSTL functions.
> I know there are workaround solutions like [1], but it would be more
> seamless, IMHO, if it cares JSTL functions as well.
> Would it be a good improvement to support JSTL functions in the core?
>
> I also browsed the source and TaglibFactory.java doesn't care "function"
> element at the moment. So I'm thinking that maybe we can improve it to
> add functor-like model object into the TaglibFactory.Taglib.tags map
> *somehow*.
> We're also interested in helping or contributing to improve this. Any
> suggestions or hints are more than welcome!
>
> By the way, we Hippo have used Freemarker as the default templating
> engine in our Web CMS products [2]. I really appreciate for this great
> library and your effort.
>
> Thanks!
>
> Kind regards,
>
> Woonsan
>
> [1]
> http://stackoverflow.com/questions/25123031/convert-jstl-function-to-freemarker
> [2]
> http://www.onehippo.org/library/concepts/web-application/hst-freemarker-support.html


------------------------------------------------------------------------------
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Supporting JSTL functions as well in FreemarkerServlet?

Woonsan Ko
Hi Daniel,

Thank you very much for your quick response!

I've just checked again what JSP 2.1 Specification says in section
JSP.2.10. It says "functions are mapped to public static methods in Java
classes. In JSP, the map is specified in the TLD.", "the specified
method must be a public static method in the specified class, and must
be specified using a fully-qualified return type followed by the method
name, followed by the fully-qualified argument types in parenthesis,
separated by commas", and "the resulting value is the value returned by
the method evaluation, or null if the Java method is declared to return
void." [1]

So, yes, they are just static methods and there's no other additional
requirements.

Also, thanks for the tips on where to look for contribution. I'll  try
to create a patch keeping BC. I'll create a ticket and attach my patch
later in https://sourceforge.net/p/freemarker/bugs/ for reviews.

Kind regards,

Woonsan

[1] https://jcp.org/aboutJava/communityprocess/final/jsr245/

On 8/9/14 9:21 AM, Daniel Dekany wrote:
> Hi,
>
> Are JSTL functions always just plain static methods, or do some of
> them have some additional requirements? Because if they are just
> static methods, then FreeMarker could certainly easily support them.
> It should be implemented inside freemarker.ext.jsp. Contributions that
> keep backward compatibility are highly welcome (will need to sign a
> typical Contributor License Agreement)!
>


--
[hidden email]     www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

------------------------------------------------------------------------------
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Supporting JSTL functions as well in FreemarkerServlet?

Daniel Dekany
Note that the up-to-date FreeMarker source code is on GitHub
(https://github.com/freemarker/freemarker), and you should develop
against the "2.3-gae" branch there (note the "gae" in the name). You
may also find that working with Git pull requests is easier than with
traditional diffs.

I will send the CLA shortly.

--
Thanks,
 Daniel Dekany


Saturday, August 9, 2014, 5:36:48 PM, Woonsan Ko wrote:

> Hi Daniel,
>
> Thank you very much for your quick response!
>
> I've just checked again what JSP 2.1 Specification says in section
> JSP.2.10. It says "functions are mapped to public static methods in Java
> classes. In JSP, the map is specified in the TLD.", "the specified
> method must be a public static method in the specified class, and must
> be specified using a fully-qualified return type followed by the method
> name, followed by the fully-qualified argument types in parenthesis,
> separated by commas", and "the resulting value is the value returned by
> the method evaluation, or null if the Java method is declared to return
> void." [1]
>
> So, yes, they are just static methods and there's no other additional
> requirements.
>
> Also, thanks for the tips on where to look for contribution. I'll  try
> to create a patch keeping BC. I'll create a ticket and attach my patch
> later in https://sourceforge.net/p/freemarker/bugs/ for reviews.
>
> Kind regards,
>
> Woonsan
>
> [1] https://jcp.org/aboutJava/communityprocess/final/jsr245/
>
> On 8/9/14 9:21 AM, Daniel Dekany wrote:
>> Hi,
>>
>> Are JSTL functions always just plain static methods, or do some of
>> them have some additional requirements? Because if they are just
>> static methods, then FreeMarker could certainly easily support them.
>> It should be implemented inside freemarker.ext.jsp. Contributions that
>> keep backward compatibility are highly welcome (will need to sign a
>> typical Contributor License Agreement)!
>>
>
>


------------------------------------------------------------------------------
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Supporting JSTL functions as well in FreemarkerServlet?

Woonsan Ko
Hi Daniel,

Thank you very much! I also realized that it was in GitHub. That's nice! :-)
I already forked it and I am working on it. I'll ask pull request soon
(maybe next week).

Cheers,

Woonsan

On 8/10/14 7:39 AM, Daniel Dekany wrote:
> Note that the up-to-date FreeMarker source code is on GitHub
> (https://github.com/freemarker/freemarker), and you should develop
> against the "2.3-gae" branch there (note the "gae" in the name). You
> may also find that working with Git pull requests is easier than with
> traditional diffs.
>
> I will send the CLA shortly.
>


--
[hidden email]     www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

------------------------------------------------------------------------------
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Supporting JSTL functions as well in FreemarkerServlet?

Woonsan Ko
Hi Daniel,

I've just asked a pull request.
Please review the changes and feel free to point out anything I possibly
missed.

Cheers,

Woonsan

On 8/10/14 10:48 PM, Woonsan Ko wrote:

> Hi Daniel,
>
> Thank you very much! I also realized that it was in GitHub. That's nice! :-)
> I already forked it and I am working on it. I'll ask pull request soon
> (maybe next week).
>
> Cheers,
>
> Woonsan
>
> On 8/10/14 7:39 AM, Daniel Dekany wrote:
>> Note that the up-to-date FreeMarker source code is on GitHub
>> (https://github.com/freemarker/freemarker), and you should develop
>> against the "2.3-gae" branch there (note the "gae" in the name). You
>> may also find that working with Git pull requests is easier than with
>> traditional diffs.
>>
>> I will send the CLA shortly.
>>
>
>


--
[hidden email]     www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

------------------------------------------------------------------------------
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Loading...