Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a $ symbol mean in a JSP

Tags:

jsp

jstl

el

First of all, please bare my ignorance. This may be a very basic question. But I am not to find it out.

I see some thing like this in the code. I dont understand what a JSTL is. Whatever I search, it redirects to JSTL related articles, which I seldom understand !

${applicationVersionNumber}

What does this mean ? From where this value is read ? Any help is highly appreciated.

Also I see the below on top of my file. Which one of these three lines is actually required for ${applicationVersionNumber} to work ?

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log"%>
like image 430
hop Avatar asked Dec 20 '11 09:12

hop


People also ask

What does <% %> mean in JSP?

<%@ is the directive attribute. You may include a page or may declare a tag-library using <%@ More on it here.

What are JSP elements?

There are three types of JSP elements you can use: directive, action, and scripting. A new construct added in JSP 2.0 is an Expression Language (EL) expression; let's call this a forth element type, even though it's a bit different than the other three.

What is the value in the expression ${( 1 2 * 3?

EL expressions can use parentheses to group subexpressions. For example, ${(1 + 2) * 3} equals 9, but ${1 + (2 * 3)} equals 7. The valid values of this attribute are true and false. If it is true, EL expressions are ignored when they appear in static text or tag attributes.


1 Answers

None of the taglib is necessary as it is a JSP 2.0 standard.

It just print the content of the variable in the document.

For more details about the EL expressions, this is the documentation you're looking for: http://java.sun.com/products/jsp/syntax/2.0/syntaxref207.html#1010522

like image 116
n1r3 Avatar answered Jan 12 '23 05:01

n1r3