在运行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> error as follows:</ HTML></ body> </ S: else>
juvenile
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
Find the solution found by the following
error message is that the label can not accept the expression el
struts2.0 major label support is ognl expression
so the <s: elseif test = "$ {age> 35}">
change <s: elseif test = "# age> 35 ">
on ok
Into the following: