jsp小问题

cc莫默 2004-11-21 04:31:32
本人是初学者
小弟在JB9下写了个程序
有三个文件

第一个jsp_include.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<html>
<body>
<%@ include file="static.html" %>
<%//只是把文件包含进来%>
<a href="two.jsp">goto two--></a><br>
this examples show include works
<jsp:include page="two.jsp" flush="true">
<jsp:param name="a1" value="<%=request.getParameter("name")%>" />
<jsp:param name="a2" value="<%=request.getParameter("password")%>" />
</jsp:include>
</body>
</html>
第二个static.html
<html>
<body>
<form method=post action="jsp_include.jsp">
<table>
<tr>
<td>please input your name:</td></tr>
<tr><td>
<input type=text name=name>
</td></tr>
<tr><td>input you password:</td>
<td>
<input type=text name=password>
</td>
</tr>
<tr>
<td>
<input type=submit value=login>
</td>
</tr>
</table>
</body>
</html>
第三个tow.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" %>
举例说明include的工作原理:
<br>
this is a1=<%=request.getParameter("a1")%>
<br>
this is a2=<%=request.getParameter("a2")%>
<br>
<% out.println("hello from two.jsp");%>
运行时,显示错误
Source E:\song\3-10\3-10\src\3-10\TwoBean.java does not define any classes or interfaces.
cannot read: E:/song/3-10/3-10/src/3-10/Jsp_includeBean.java
"jsp_include.jsp": Attribute name has no value at line 9, column 58
请多指教
我是个初学者,如果你有请加我,317417158
...全文
104 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
redspider9999 2004-11-21
  • 打赏
  • 举报
回复
你的第一个jsp文件中include了第三个jsp文件。而这两个文件中都存在有
<%@ page contentType="text/html; charset=gb2312" language="java" %>,将two.jsp中的去掉就可以了。
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
还是不对呀,兄弟
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
不好用呀
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
我什么也没选呀
redex 2004-11-21
  • 打赏
  • 举报
回复
你试试再建立一个工程吧,在jb中很简单的。
jFresH_MaN 2004-11-21
  • 打赏
  • 举报
回复
Source E:\song\3-10\3-10\src\3-10\TwoBean.java does not define any classes or interfaces.
cannot read: E:/song/3-10/3-10/src/3-10/Jsp_includeBean.java
这个问题我就不知道是怎么回事了,因为这两个文件都很莫名

"jsp_include.jsp": Attribute name has no value at line 9, column 58
这个是很明显的,因为第一次执行时,根本没有request请求发过来,所以会报错
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
如果建好了, 能不能在JB里直接改
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
redex(cc)这位兄弟有QQ吗,
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
各位,不要嫌问题太简单
redex 2004-11-21
  • 打赏
  • 举报
回复
在建立jsp文件时不要选“自动生成bean”
cc莫默 2004-11-21
  • 打赏
  • 举报
回复
有人能帮我吗?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧