在线工具 在线编程 在线白板 在线工具 在线编程 在线白板

急急急 jsp 错误 org.apache.jasper.JasperException: Unable to compile class for

抄书上的程序,加上这些代码就错误了。
<jsp:include page="child2.jsp" flush="true">
<jsp:param name="username" value="<%=request.getParameter("username")%>"/>
<jsp:param name="age" value="<%=request.getParameter("age")%>"/>
<jsp:param name="msn" value="<%=request.getparameter("msn")%>"/>
</jsp:include>
最新回答
梦散蝶逝

2025-03-27 04:06:11

这个你要看你在child2.jsp这个页面有没有
<jsp:param name="username" value="<%=request.getParameter("username")%>"/>
<jsp:param name="age" value="<%=request.getParameter("age")%>"/>
<jsp:param name="msn" value="<%=request.getparameter("msn")%>"/>
这三个属性,如果没有导如这个页面的时候就会出错,因为request.getParameter("属性名称")的值为空
心里下着雨

2025-03-27 10:35:32

你的语法都对... 你的问题是Compilation Error, 并非Runtime Error, 就是 说跟里面的Parameters还是其它的没有关系... 是Jasper在COMPILE的时候出现某些问题,导致无法COMPILE.
这里问题只可能是child2.jsp这个PAGE你根本就没建. 因为Apache Jasper无法找到child2.jsp, 所以跟本就不能COMPILE.
如果是PARAMETER有NULL的话, 一定是NullPointerException,如果其他的问题出现, 都必然是RuntimeException的子Exception.
看下Documentaton:
http://java.sun.com/products/jsp/tags/11/syntaxref1112.html
风清淡雅

2025-03-27 10:41:04

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 11 in the jsp file: /index.jsp
HTreeForHtml cannot be resolved to a type
8: <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
9: <%@ page import="javax.swing.tree.*" %>
10: <%@ page import="shilei.*" %>
11: <%!HTreeForHtml hTree;%>
12:
13: <html>
14: <head>
你是我所有的梦

2025-03-27 04:04:45

<jsp ...></jsp>
标签中不能加 <%%>。
你这么写明显错误。
一枝沈荼

2025-03-27 10:11:10

你需要给出错误提示。
念河山远

2025-03-27 07:35:57

<jsp:param>这个标签得更一个东西一起用,至于是什么,我忘了,你查查书吧,也就是得这么用:<jsp:param>xxx</jsp:param>,xxx就是那个缺少的东西。