Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the JSP and the JSTL? [duplicate]

Tags:

jsp

jstl

I have learned about servlets and the JSP's before, but I don't know what is the JSTL and the difference between the JSP and the JSTL.

like image 972
Questions Avatar asked Sep 15 '10 07:09

Questions


People also ask

What is the difference between JSP and tag file?

A tag file is a source file that contains a fragment of JSP code that is reusable as a custom tag. Tag files allow you to create custom tags using JSP syntax. Just as a JSP page gets translated into a servlet class and then compiled, a tag file gets translated into a tag handler and then compiled.

What is JSTL used for?

JSTL stands for JSP Standard Tag Library. JSTL is the standard tag library that provides tags to control the JSP page behavior. JSTL tags can be used for iteration and control statements, internationalization, SQL etc.

What is the difference between import and include in JSP?

The key difference between include action and JSTL import tag is that the former can only include local resources but later can also include the output of remote resources, JSP pages, or HTML pages outside the web container. include action uses page attribute while import tag uses URL attribute.

What is JSTL and its advantages?

Advantage of JSTL Fast Development JSTL provides many tags that simplify the JSP. Code Reusability We can use the JSTL tags on various pages. No need to use scriptlet tag It avoids the use of scriptlet tag.


1 Answers

JSP is a technology similar to ASP that let you embed Java code inside HTML pages. This code can be inserted by means of <% %> blocks or by means of JSP tags. The last option is generally preferred over the first one, since tags adapt better to own tag representation form of HTML, so your pages will look more readable. JSP lets you even define your own tags (you must write the code that actually implement the logic of those tags in Java). JSTL is just a standard tag library provided by Sun (well, now Oracle) to carry out common tasks (such as looping, formatting, etc.).

like image 104
Fernando Miguélez Avatar answered Oct 13 '22 22:10

Fernando Miguélez