大家帮我看看,可能是jsp:include的问题,急~~~~

ayace 2004-10-27 09:31:04
jsp文件:


test.jsp:
<%@ page contentType="text/html;charset=GB2312" %>
<HTML>
<BODY bgcolor=cyan><Font size=1 >
<P>您想使用什么方式查看文本文件A.txt?
<FORM action="tree3.jsp" method="post" name=form>
<INPUT TYPE="submit" value="word" name="submit1">
<INPUT TYPE="submit" value="excel" name="submit2">
</FORM>
</FONT>
</BODY>
</HTML>


tree3.jsp:
<%@ page contentType="text/html;charset=GB2312" %>
<HTML>
<BODY>
<% String str1=request.getParameter("submit1");
String str2=request.getParameter("submit2");
if(str1==null)
{str1="";
}
if(str2==null)
{str2="";
}
if(str1.startsWith("word"))
{response.setContentType("application/msword;charset=GB2312");
out.print(str1);
}
if(str2.startsWith("excel"))
{response.setContentType("application/x-msexcel;charset=GB2312");
}
%>
<jsp:include page="A.txt" flush="true">
</jsp:include>
</BODY>
</HTML>


用浏览test.jsp无问题,点按钮进入tree3.jsp,出现错误
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /tree3.jsp(20,0) Expected "param" tag with "name" and "value" attributes
........

后面还有很多,哪位达人教教我啊,谢谢,分不够我再加。
...全文
109 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jinannanhai79 2004-10-29
  • 打赏
  • 举报
回复
String str1=request.getParameter("submit1");
String str2=request.getParameter("submit2");
有一个变量取不到值,所以将null赋值的时候出错,先做一下非空的判断,
String str1 = "";
if(request.getParameter("submit1") != null)
str1=request.getParameter("submit1");

xinfeng802 2004-10-28
  • 打赏
  • 举报
回复
String str1=request.getParameter("submit1");
String str2=request.getParameter("submit2");
这两句出错了吧
tom2005 2004-10-28
  • 打赏
  • 举报
回复

<jsp:include page="A.txt" flush="true"/>
rainboy20024 2004-10-27
  • 打赏
  • 举报
回复
<jsp:include page="A.txt" flush="true"/>
grpengwei 2004-10-27
  • 打赏
  • 举报
回复
要用include file =""
试试
ayace 2004-10-27
  • 打赏
  • 举报
回复
怎么没人帮忙?郁闷。

81,122

社区成员

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

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