1、错误描述

javax.servlet.JspTagException:Illegal use of <when>-style tag without <choose >as its direct parent

2、错误原因

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <title></title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

  </head>

  <body>
     <table>
         <tr>
           <th>时间</th>
           <th>地域</th>
           <th>姓名</th>
           <th>年龄</th>
           <th>性别</th>
           <th>QQ</th>
           <th>地址</th>
           <th>爱好</th>
           <th>备注</th>
         </tr>
         <tr>
           <c:forEach var="area" varStatus="areaStatus" items="{areaList}">
           		<c:when test="areaList == null || areaList.size()==0">
           			<td colspan="9"><center>无数据</center></td>
           		</c:when>
           		<c:otherwise>
           			<td>${area.statisDate}</td>
           			<td>${area.areaDesc}</td>
           			<td>${area.username}</td>
           			<td>${area.age}</td>
           			<td>${area.sex}</td>
           			<td>${area.qq}</td>
           			<td>${area.address}</td>
           			<td>${area.intester}</td>
           			<td>${area.shuoMing}</td>
           		</c:otherwise>
           </c:forEach>
         </tr>
     </table>
  </body>
</html>

3、解决办法

(1)将<c:when></c:when>换成<c:if>

(2)利用struts2中的s标签中的<s:if>

javax.servlet.JspTagException:Illegal use of &lt;when&gt;-style tag without &lt;choose &gt;as its di的更多相关文章

  1. HTTP Status 500 - javax.servlet.ServletException

    运行某个jsp页面时提示 type Exception report message javax.servlet.ServletException: java.lang.NoClassDefFound ...

  2. 关于javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in &lt;forEach&gt;

    今天遇到这样一个异常: 严重: Servlet.service() for servlet jsp threw exceptionjavax.servlet.jsp.JspTagException: ...

  3. [springMVC]javax.servlet.jsp.JspTagException: Neither BindingResult nor plain target object for bean

    问题描述: 页面使用标签<form:form>进行提交时,出现[springMVC]javax.servlet.jsp.JspTagException: Neither BindingRe ...

  4. 【原】tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig的解决

    现象: tomcat 7 启动报错:java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig() ...

  5. 使用javax.servlet.http.Part类上传文件

    使用的是Servlet 3.0 新的特征标注(Annotaion)类描述部署,一些低版本的服务器需要使用标准依赖部署描述文件(web.xml)来部署,另外Part也是Java EE 6.0新增的类,P ...

  6. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path解决方案

    0.环境: win7系统,Tomcat9配置无误. 1.错误: 项目中某一.jps页面忽然出现错误,鼠标点上去为:The superclass "javax.servlet.http.Htt ...

  7. The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path。问题

    JSP页面顶端出现“红色”的报错信息:The superclass "javax.servlet.http.HttpServlet" was not found on the Ja ...

  8. java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted()Z 的解决

    jetty 9 嵌入式开发时,启动正常,但是页面一浏览就报错如下: java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest ...

  9. NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

    今天调试SSM框架项目后台JSOn接口,报出来一个让人迷惑的错误:NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 上网查了一下别人的博 ...

随机推荐

  1. 获取IP Address

    public string GetUserIp() { var visitorsIpAddr = string.Empty; if (System.Web.HttpContext.Current.Re ...

  2. windows下cmd常用

    windows下cmd常用 shutdown -s -t 2------2秒后关机 加上-f选项意思是强制执行 shutdown -r -t 2------2秒后重启 加上-f选项意思是强制执行 lo ...

  3. 《Thinking in Java》学习笔记(六)

    1.Class相关知识 Class类可以理解为类的图纸,通过Class类可以分析类的结构.构建出类的实例. Class.forName("test.TestClass").newI ...

  4. STP协议

    STP协议的作用: 第一, 可以避免网络环路和广播风暴. 二层数据包是没有TTL(time to live)的,如果不加以限制,可能会无限的传播下去.二层设备间如果存在环路,大量的广播包就可能导致广播 ...

  5. RMI基础

    远程方法调用(Remote Method Invocation,RMI)从JDK1.1就已经实现,它大大增强了Java开发分布式应用的能力.可以实现通过网络完成不同JVM间的通信,不仅可以传递基本的数 ...

  6. 洛谷 [P1280] 尼克的任务

    DP 题目问的是最大空暇时间,那么就定义dp[i]为第i分钟的最大空暇时间,显然满足最优子结构,我们发现dp[i]仅与其后的值有关,那么从后往前推,如果第i分钟没有任务,dp[i]=dp[i+1],如 ...

  7. BZOJ 3697: 采药人的路径 [点分治] [我想上化学课]

    传送门 题意: 路径有$-1,1$两种权值,求有多少路径满足权值和为$0$且有一个点将路径分成权值和为$0$的两段 第四节课本来想去上化学,然后快上课了这道题还没调出来.....可恶我想上化学 昨天两 ...

  8. ubuntu14.04安装、NVIDIA显卡驱动安装及CUDA8.0、Cudnn5.1的环境搭建

    安装环境:hp-Z440工作站.64位Ubuntu14.04(64位Ubuntu16.04).Cuda8.0.Cudnn5.1.Nvidia GeForce GT 705.Tesla K40c 本文可 ...

  9. 算法&数据结构系列 -- 堆(优先队列)

    前言 话说新开的博客十分好用... 所以,我打算开一个坑,名曰[算法系列]. 什么意思--从名字泥应该就猜得出来... 废话不多说,进入正文~~ 正文 原理 首先,堆是一颗棵二叉树.. 其次,堆是一棵 ...

  10. tcp_sync_server and tcp_sync_client

    #include <iostream> #include <fstream> #include <sstream> #include <boost/asio. ...