jstl中无法使用el表达式的解决方法

1.到jsp页面加上
<%@ taglib uri="http://java.sun.com/jstl/core"prefix="c"%>
加入 jstl.jar 和standard.jar到web-inf/lib下就可以解析el表达式了
或者在jsp页面加上:<%@ page isELIgnored="false" %>

2.如果还不可以直接到web.xml中配置如下代码:
<jsp-config>
        <jsp-property-group>
            <description>指定JSP文件的配置属性</description>
            <display-name>jspConfiguration</display-name>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>false</el-ignored>
            <page-encoding>utf-8</page-encoding>
            <scripting-invalid>false</scripting-invalid>
            <include-prelude></include-prelude>
            <include-coda></include-coda>
        </jsp-property-group>

        <jsp-property-group>
            <description>指定htm文件的配置属性</description>
            <display-name>jspConfiguration</display-name>
            <url-pattern>*.htm</url-pattern>
            <el-ignored>false</el-ignored>
            <page-encoding>utf-8</page-encoding>
            <scripting-invalid>false</scripting-invalid>
            <include-prelude></include-prelude>
            <include-coda></include-coda>
        </jsp-property-group>

        <jsp-property-group>
            <description>指定html文件的配置属性</description>
            <display-name>jspConfiguration</display-name>
            <url-pattern>*.html</url-pattern>
            <el-ignored>false</el-ignored>
            <page-encoding>utf-8</page-encoding>
            <scripting-invalid>false</scripting-invalid>
            <include-prelude></include-prelude>
            <include-coda></include-coda>
        </jsp-property-group>

    </jsp-config>

一般不会出现问题了

你可能感兴趣的:(html,jsp,Web,xml,sun)