被EL表达式坑了一下午,终于找到了解决方法

我的EL表达式在jsp中写的${username} ,

然而不给力的是在页面上显示的也是${username},

这就很烦,但是经过在各大社区的询问之下终于找到了问题的所在之处,

在jsp中添加

<%@ page isELIgnored="false" %>


之前的各种尝试:

maven中导包:

        <!-- https://mvnrepository.com/artifact/taglibs/standard -->
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/javax.servlet/jstl -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>

        </dependency>

这招行不通;


页面中的各种尝试可结果还是行不通;


从图中可以看出C已经成功导入;

各种想象,绞尽脑汁还是灭有想出来,

最后在大佬的精心指点下才发现EL表达式被默认关闭了

这个是个比较坑的举动,可以在web.xml中配置

详情请查看链接跳转:

点击打开链接 https://www.cnblogs.com/mlloc-clove/p/3550498.html

<jsp-config>
        <taglib>
            <taglib-uri>Taglib</taglib-uri>
            <taglib-location>/WEB-INF/tlds/MyTaglib.tld</taglib-location>
        </taglib>
        <jsp-property-group>
            <description>Special property group for JSP Configuration JSP example.</description>
            <display-name>JSPConfiguration</display-name>
            <url-pattern>/jsp/* </url-pattern>
            <el-ignored>true</el-ignored>
            <page-encoding>GB2312</page-encoding>
            <scripting-invalid>true</scripting-invalid>
            <include-prelude>/include/prelude.jspf</include-prelude>
            <include-coda>/include/coda.jspf</include-coda>
        </jsp-property-group>
    </jsp-config>

在jsp中配置也行如下:

<%@ page isELIgnored="false" %>



  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值