Using JSTL, taglibs and custom tags in JSP-alternative projects based on Thymeleaf, Apache Velocity, Apache...
I know two facts:
1) EL (later Unified EL) and taglibs (custom tag libraries, including JSTL) are used within JSP and designed specifically for use within JSP.
2) Alternatives to JSP are: Thymeleaf, Apache Velocity, Apache Freemarker, Facelets (within bigger JSF framework). Plus Struts (it is very old, but still is an "alternative").
My question is: a) is it possible and b) is it good practice to use EL and custom tags / taglibs (including JSTL) within projects using JSP alternatives, or they are JSP-specific and cannot be used outside of JSP?
I think that all those can be used in Facelets/JSF, because before Facelets JSF was JSP-based and I still can mix JSP and Facelets. But what about projects with Thymeleaf, Apache Velocity, Apache Freemarker? And Struts2?
jsp java-ee thymeleaf jsp-tags taglib
add a comment |
I know two facts:
1) EL (later Unified EL) and taglibs (custom tag libraries, including JSTL) are used within JSP and designed specifically for use within JSP.
2) Alternatives to JSP are: Thymeleaf, Apache Velocity, Apache Freemarker, Facelets (within bigger JSF framework). Plus Struts (it is very old, but still is an "alternative").
My question is: a) is it possible and b) is it good practice to use EL and custom tags / taglibs (including JSTL) within projects using JSP alternatives, or they are JSP-specific and cannot be used outside of JSP?
I think that all those can be used in Facelets/JSF, because before Facelets JSF was JSP-based and I still can mix JSP and Facelets. But what about projects with Thymeleaf, Apache Velocity, Apache Freemarker? And Struts2?
jsp java-ee thymeleaf jsp-tags taglib
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43
add a comment |
I know two facts:
1) EL (later Unified EL) and taglibs (custom tag libraries, including JSTL) are used within JSP and designed specifically for use within JSP.
2) Alternatives to JSP are: Thymeleaf, Apache Velocity, Apache Freemarker, Facelets (within bigger JSF framework). Plus Struts (it is very old, but still is an "alternative").
My question is: a) is it possible and b) is it good practice to use EL and custom tags / taglibs (including JSTL) within projects using JSP alternatives, or they are JSP-specific and cannot be used outside of JSP?
I think that all those can be used in Facelets/JSF, because before Facelets JSF was JSP-based and I still can mix JSP and Facelets. But what about projects with Thymeleaf, Apache Velocity, Apache Freemarker? And Struts2?
jsp java-ee thymeleaf jsp-tags taglib
I know two facts:
1) EL (later Unified EL) and taglibs (custom tag libraries, including JSTL) are used within JSP and designed specifically for use within JSP.
2) Alternatives to JSP are: Thymeleaf, Apache Velocity, Apache Freemarker, Facelets (within bigger JSF framework). Plus Struts (it is very old, but still is an "alternative").
My question is: a) is it possible and b) is it good practice to use EL and custom tags / taglibs (including JSTL) within projects using JSP alternatives, or they are JSP-specific and cannot be used outside of JSP?
I think that all those can be used in Facelets/JSF, because before Facelets JSF was JSP-based and I still can mix JSP and Facelets. But what about projects with Thymeleaf, Apache Velocity, Apache Freemarker? And Struts2?
jsp java-ee thymeleaf jsp-tags taglib
jsp java-ee thymeleaf jsp-tags taglib
asked Nov 25 '18 at 13:39
caasdadscaasdads
1347
1347
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43
add a comment |
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43
add a comment |
1 Answer
1
active
oldest
votes
Freemarker supports EL and custom tags / taglibs:
Using JSP custom tags in FTL
FreemarkerServlet puts the JspTaglibs hash into the data-model, which you can use to access JSP taglibs. The JSP custom tags will be accessible as plain user-defined directives, and the custom EL functions (since FreeMarker 2.3.22) as methods.
Also Spring moved from Velocity to FreeMarker as default template engine
Velocity Templating support was being phased out in favor of FreeMarker.
Notice also FreeMarker is no longer in incubation status in Apache projects
The FreeMarker project graduated on 2018-03-21
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53468038%2fusing-jstl-taglibs-and-custom-tags-in-jsp-alternative-projects-based-on-thymele%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Freemarker supports EL and custom tags / taglibs:
Using JSP custom tags in FTL
FreemarkerServlet puts the JspTaglibs hash into the data-model, which you can use to access JSP taglibs. The JSP custom tags will be accessible as plain user-defined directives, and the custom EL functions (since FreeMarker 2.3.22) as methods.
Also Spring moved from Velocity to FreeMarker as default template engine
Velocity Templating support was being phased out in favor of FreeMarker.
Notice also FreeMarker is no longer in incubation status in Apache projects
The FreeMarker project graduated on 2018-03-21
add a comment |
Freemarker supports EL and custom tags / taglibs:
Using JSP custom tags in FTL
FreemarkerServlet puts the JspTaglibs hash into the data-model, which you can use to access JSP taglibs. The JSP custom tags will be accessible as plain user-defined directives, and the custom EL functions (since FreeMarker 2.3.22) as methods.
Also Spring moved from Velocity to FreeMarker as default template engine
Velocity Templating support was being phased out in favor of FreeMarker.
Notice also FreeMarker is no longer in incubation status in Apache projects
The FreeMarker project graduated on 2018-03-21
add a comment |
Freemarker supports EL and custom tags / taglibs:
Using JSP custom tags in FTL
FreemarkerServlet puts the JspTaglibs hash into the data-model, which you can use to access JSP taglibs. The JSP custom tags will be accessible as plain user-defined directives, and the custom EL functions (since FreeMarker 2.3.22) as methods.
Also Spring moved from Velocity to FreeMarker as default template engine
Velocity Templating support was being phased out in favor of FreeMarker.
Notice also FreeMarker is no longer in incubation status in Apache projects
The FreeMarker project graduated on 2018-03-21
Freemarker supports EL and custom tags / taglibs:
Using JSP custom tags in FTL
FreemarkerServlet puts the JspTaglibs hash into the data-model, which you can use to access JSP taglibs. The JSP custom tags will be accessible as plain user-defined directives, and the custom EL functions (since FreeMarker 2.3.22) as methods.
Also Spring moved from Velocity to FreeMarker as default template engine
Velocity Templating support was being phased out in favor of FreeMarker.
Notice also FreeMarker is no longer in incubation status in Apache projects
The FreeMarker project graduated on 2018-03-21
answered Nov 25 '18 at 14:57
user7294900user7294900
22.8k113361
22.8k113361
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53468038%2fusing-jstl-taglibs-and-custom-tags-in-jsp-alternative-projects-based-on-thymele%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can use multiple template Resolvers see stackoverflow.com/questions/28480223/…
– user7294900
Nov 25 '18 at 13:43