Home  >  Article  >  Java  >  What version of jsp supports el expressions

What version of jsp supports el expressions

(*-*)浩
(*-*)浩Original
2019-05-18 15:50:482919browse

By default, the "Servlet 2.4/JSP2.0" version of jsp supports EL, but "Servlet2.3/1.2" does not support EL expressions. The "servlets 2.4" version of "isELIgnored" The default is "false", "servlets 2.5" is not supported by default.

What version of jsp supports el expressions

In JSP2.0, EL language is added, which can be used to obtain data and further transfer the scriptlet code from the JSP page. separated from .

EL language brings convenience to everyone, but sometimes, you will encounter situations where EL expressions cannot be displayed. Below, I will list several situations where EL expressions cannot be displayed and their solutions. Solution:

1.WEB-INF/web.xml, the deployment description file of the web application refers to version 2.3 or earlier of the servlet specification (i.e. jsp1.2

or earlier earlier), the jsp2.0 expression language is automatically disabled in the web application. Note that the version attribute should be version 2.4 and above.

If it is version 2.3, the xml directive and document type The definition is as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

If it is version 2.4, it is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

2. In web.xml, whether the jsp expression is disabled Formula language

<jsp-config>
<jsp-property-group>
<url-pattern>/legacy/*.jsp</url-pattern>
<el-ignored>true</el-ignored>
</jsp-property-group>
</jsp-config>

The solution to this situation is to change true to false

3. Disable jsp expression language on the page

<%@ page isELEnabled ="false"%>

Solution: Change to< ;%@ page isELEnabled ="true"%>

2.4 version supports el expression by default. If you use version 2.5, el expression is turned off by default, and the above <%@ page isELEnabled =" true"%>can no longer be used.

Then the jsp page should add <%@ page isELIgnored="false"%>

The above is the detailed content of What version of jsp supports el expressions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn