jsp tag taglib not working problem

JSTL <c:out value="${EL}"> cannot be output correctly

Due to the backward compatibility of Jsp2.0, JSP2.0 EL will be disabled by default when encountering a website using Jsp 1.2 (Servlet v2.3), so c:out cannot be output correctly.
(Note here that JSP 1.2 disables the EL of JSP2.0, and instead uses JSTL 1.0 taglib to parse EL. Therefore, there will be no problem using JSP 1.2+JSTL 1.0, but using
JSP 1.2+JSTL 1.1 will cause c:out to fail. correct output)

Enabling EL or modifying webv.xml to jsp2.0 can solve the problem.

 

Enable EL: Add <%@ page isELIgnored="false"%> to the jsp page. The
isELIgnored attribute of the page directive controls the right to use EL. Its two values, true and false,
if isELIgnored='true' means disabling EL ,isELIgnored='false' means EL can be used, the default is false

 

Modify web.xml to jsp2.0

To use EL change to
<?xml version="1.0" encoding="ISO-8859-1"?>

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

  <display-name>WebModule1 </display-name>
</web-app>

Supongo que te gusta

Origin blog.csdn.net/QWERT520/article/details/5159498
Recomendado
Clasificación