Expecting "jsp:param" standard action with "name" and "value" attributes错误
错误信息如下:
Servlet.service() for servlet [jsp] in context with path [/20161017] threw exception [/tag/simpleTag.jsp (line: 25, column: 44) Expecting "jsp:param" standard action with "name" and "value" attributes] with root cause
org.apache.jasper.JasperException: /tag/simpleTag.jsp (line: 25, column: 44) Expecting "jsp:param" standard action with "name" and "value" attributes
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:91)
at org.apache.jasper.compiler.Parser.parseParam(Parser.java:829)
at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1681)
at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1006)
at org.apache.jasper.compiler.Parser.parseForward(Parser.java:870)
at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1122)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1459)
at org.apache.jasper.compiler.Parser.parse(Parser.java:139)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
simple.jsp文件如下:
<%@ page import="java.util.* ,com.tt.javaweb.Customer" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
//模拟Servlet中的操作
List<Customer> customers = new ArrayList<Customer>();
customers.add(new Customer(1,"AA",12));
customers.add(new Customer(2,"BB",13));
customers.add(new Customer(3,"CC",14));
customers.add(new Customer(4,"DD",15));
customers.add(new Customer(5,"EE",16)); request.setAttribute("customers", customers); %> <jsp:forward page="testTag.jsp"></page:forward> </body>
</html>
testTag.jsp文件如下:
<%@ page import="java.util.* ,com.tt.javaweb.Customer" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body> <!-- 在页面上对request中的customers属性进行遍历,打印id,name,age -->
<%
List<Customer> customers = (List<Customer>)request.getAttribute("customers");
if(customers != null) {
for(Customer customer : customers){
%> <%= customer.getId() %> ,<%= customer.getName() %> ,<%= customer.getAge() %> <%
}
} %> </body>
</html>
原因:在simpleTag.jsp中的forward标签写错了!
总结该错误可能出现的原因:
1.标签的开始和结束不一致:比如我犯的这个错
2.没有结束标签:<jsp:forward page="testTag.jsp">,应该是<jsp:forward page="testTag.jsp"/>
3.没有参数的标签,结束时不能换行:
<jsp:forward page="testTag.jsp">
</jsp:forward>
应该是<jsp:forward page="testTag.jsp"></jsp:forward>
Expecting "jsp:param" standard action with "name" and "value" attributes错误的更多相关文章
- org.apache.jasper.JasperException: Expecting "jsp:param" standard action with "name" and "value" attributes
jasper 英 ['dʒæspə] 美 ['dʒæspɚ] 跟读 口语练习 n. 碧玉:墨绿色 n. (Jasper)人名:(德)雅斯佩尔:(西)哈斯佩尔 JasperException 异 ...
- Expecting "jsp:param" standard action with "name" and "value" attributes
浏览器访问报如下jsp标签错误: 根据提示,定位到jsp页面124行,代码如下: 查找原因,当<jsp:include></jsp:include>标签中没有参数时,不允许有空 ...
- 报错信息 The jsp:param action must not be used outside the jsp:include, jsp:forward, or jsp:params elements 的原因及解决办法
如果你的代码是这样的话就会报错 <jsp:forward page="02.jsp"></jsp:forward> <jsp:param value= ...
- JavaBean组件<jsp:forward>动作<jsp:param>动作登录页面输入用户名和密码,然后进入检查页面判断是否符合要求,符合要求跳转到成功界面,不符合要求返回登录界面,显示错误信息。
JavaBean组件 JavaBean组件实际是一种java类.通过封装属性和方法成为具有某种功能或者处理某个业务的对象. 特点:1.实现代码的重复利用.2.容易编写和维护.3.jsp页面调用方便. ...
- <转> jsp页面向action传值的方法(最后一种简单)
多的不说,直接上代码; struts.xml代码: <?xml version="1.0" encoding="UTF-8"?> <!DOCT ...
- <jsp:param>标签给属性赋值时的一个坑
http://blog.sina.cn/dpool/blog/s/blog_58c5066001011gdn.html 因为: <jsp:forward和<jsp:param在被编译成ja ...
- JSP动作元素<jsp:include>和<jsp:param>的搭配使用
最近开发项目中广告头的优化:引入了<jsp:include page="XX.jsp"></jsp:include> 当<jsp:include> ...
- <jsp:param>传参乱码问题
在添加参数的界面添加<%request.setCharacterEncoding("UTF-8");%> 实例代码: login_confirm.jsp <%@ ...
- java: jsp:param中文乱码
java: jsp:param中文乱码 假如a.jsp/b.jsp文件中 a.jsp代码: 需要加入:request.setCharacterEncoding("UTF-8") ...
随机推荐
- Ubuntu12.04安装中文字体(转)
1.在/usr/share/fonts/下,新建文件夹winFonts,如果没有fonts目录,就安装fontconfig软件(系统字体管理),再将win7字体msyh.ttf和msyhbd.ttf复 ...
- AXIOM解析XML 详细原理
转自:http://warlaze.blog.sohu.com/58477971.html AXIOM Axis对象模型(AXIOM)是一个XML对象模型,设计用于提高XML处理期间的内存的使用率和性 ...
- leetcode 145. Binary Tree Postorder Traversal ----- java
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary t ...
- LOAD TABLE tbl_name FROM MASTER语法 SQL
用于把表的拷贝从主服务器转移到从属服务器.本语句的主要作用是调试LOAD DATA FROM MASTER.它要求用于连接主服务器的帐户拥有对主服务器的RELOAD和SUPER权限,并拥有对要载入的主 ...
- P235 实战练习(集合类2)、摇奖程序和验证码(修改版)
1.分别向Set集合以及List集合中添加“A”.“a”.“c”.“C”.“a”5个元素,观察重复值“a”能否在List集合以及Set集合中成功添加. package org.hanqi.practi ...
- Python正则表达式总结
正则表达式也一直用,但是没系统的总结过,今天借这个时间梳理一下. Python中的正则表达式操作依靠re模块儿完成. 常用的方法: re.compile(pattern,flags=0) #返回一个编 ...
- Unix Linux 编程书籍
UNIX环境高级编程(第3版) Advanced Programming in the UNIX Environment Linux/UNIX系统编程手册 Linux/UNIX系统编程手册 (豆瓣) ...
- MAVEN build ,GOAL plugin ,execution
http://www.avajava.com/tutorials/lessons/what-are-the-phases-of-the-maven-clean-lifecycle.html https ...
- SPL迭代器的工作和代理模式OuterIterator
1.迭代器通过foreach语言结构来实现迭代,没有实现迭代器接口(Iterator)的普通对象使用foreach结构会遍历公共属性. 2.OuterIterator用于做为实际迭代器的代理(即代理模 ...
- 通过js对表单对象的便捷获取
<form name="a"> <input name="s" value="33"/> </form> ...