在运行struts2标签页面时报错,代码如下:
<%@ page language="java" pageEncoding="gbk"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>index</title>
</head>
<body>
  <s:set name="age" value="29" />
  <s:if test="${age > 60}">
      老年人
  </s:if>
  <s:elseif test="${age > 35}">
      中年人
  </s:elseif>
  <s:elseif test="${age > 15}" id="wawa">
   青年人
  </s:elseif>
  <s:else>
      少年
  </s:else>
</body>
</html>

错误提示如下:
2008-3-12 10:53:13 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /taglib/ifelse.jsp(17,2)According to TLD or attribute directive in tag file, attribute test does not accept any expressions

经查找发现解决办法如下
错误提示是,该标签不能接受el表达式
struts2.0标签主要支持的是ognl表达式
所以把<s:elseif test="${age > 35}">
改为<s:elseif test="#age>35">
就ok了

改成下面:

SSH项目中使用struts-tags报错According to TLD or attribute directive in tag file, attribute test does not accept any expressions的更多相关文章

  1. 使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any ex ...

  2. 使用jstl标签报错:According to TLD or attribute directive in tag file, attribute value

    原来jstl标签版本不一样,标签支持不一样. jstl1.0标签库不支持表达式,如: <c:if test="${query01 == null}">   <js ...

  3. EL表达式报错:  According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any ex ...

  4. According to TLD or attribute directive in tag file, attribute value does not accept any expressions报错解决办法

    1.出现原因: 导入的uri由于不是正确的导致这个jstl不支持el的表达式 jstl uri导入错误:   <%@ taglib prefix="c" uri=" ...

  5. jstl 中无法使用EL语句。异常信息:According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    JSTL 标签库的有两种 taglib 伪指令, 其中 RT 库即是依赖于 JSP 传统的请求时属性值, 而不是依赖于 EL 来实现: 只要将 <%@ taglib uri="http ...

  6. ASP.NET CORE MVC 2.0 项目中引用第三方DLL报错的解决办法 - InvalidOperationException: Cannot find compilation library location for package

    目前在学习ASP.NET CORE MVC中,今天看到微软在ASP.NET CORE MVC 2.0中又恢复了允许开发人员引用第三方DLL程序集的功能,感到甚是高兴!于是我急忙写了个Demo想试试,我 ...

  7. vue-cli创建的项目中引入第三方库报错 'caller', 'calle', and 'arguments' properties may not be...

    http://blog.csdn.net/sophie_u/article/details/76223978 以在vue中引入mui第三方库为例: 虽然针对vue,有单独的vue-mui库可以使用,但 ...

  8. Vue 项目中的ESlint语法报错问题

    在项目中的""和;经常会报错,真的很纠结,今天看到一个解决方法,可以不用卸载删除 在项目根目录中,新建一个.prettierrc文件,来移除分号,和替换为单引号. { " ...

  9. vue-cli创建的项目中引入第三方库报错'caller', 'calle', and 'arguments' properties may not be...

    本文链接:https://blog.csdn.net/Sophie_U/article/details/76223978 问题: 在vue的main.js中引入mui.min.js时,报错. 如上,单 ...

随机推荐

  1. grpc的简单用例 (C++实现)

    这个用例的逻辑很简单, 服务器运行一个管理个人信息的服务, 提供如下的四个服务: (1) 添加一个个人信息 注: 对应于Unary RPCs, 客户端发送单一消息给服务器, 服务器返回单一消息 (2) ...

  2. ISCC之web2

    Php代码审计 PHP代码 <?php error_reporting(0); require 'flag.php'; $value = $_GET['value']; $password = ...

  3. 自定义Lombok注解

    Java 是一门"繁琐"的语言,使用 Lombok 可以显著地减少样板代码.比如使用 @Getter 注解可以为你的私有属性创建 get 方法. 源代码 @Getter priva ...

  4. typescript 参数类型

    1.参数类型:在参数名称后面使用冒号来指定参数的类型 var myname:string = 'wzn' => "use strict"; var myname = 'wzn ...

  5. PS批量截取图片

    本文提供的是需要截取大量图片的方法,仅供参考. 打开ps,在菜单栏找到窗口,点击窗口里面的动作 窗口右上方 或者下方会出现一个小窗口 点击小窗口右下角删除图标旁边的图标新建动作,工作名称:截取图片 . ...

  6. 云计算---记一次黑客攻击openstack创建的虚拟机

    一:问题定位 现象: 近期发现有几台openstack云主机被修改密码并被肉鸡. 黑客操作日志: -- :: ##### root tty1 : #### -- :: top -- :: ##### ...

  7. 安装k8s,高可用3 master安装脚本

    每个在新集群里,记得更改三个节点的IP即可. 第一步还是要执行那个root脚本,准备好系统环境,安装好软件. 先安装在每个节点上使用docker安装好etcd.(sh script domain et ...

  8. 安装k8s,使用root帐号的初始化脚本

    现在稳定性差不多了.可以总结一下了. 真正使用时,有几个地方,还是确认一下,再正式运行吧. #!/bin/bash # Version V0. ---: ;fi K8S_VERSION="1 ...

  9. Ajax -02 -JQuery+Servlet -实现页面点击刷出表格数据

    demo功能分析 jquery 的js文件需要导入,json的三个文件需要导入,不然writeValueAsString 会转化成JsonArray(json 数组)失败 $("#mytbo ...

  10. python算法与数据结构-选择排序算法(33)

    一.选择排序的介绍 选择排序(Selection sort)是一种简单直观的排序算法.首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素, ...