日期:2014-05-18  浏览次数:21102 次

Expecting "jsp:param" standard action with "name" and "value" attributes问题
书上的程序:
<%page   contentType= "text/html;charset=gb2312 "%>

<%
String   s=request.getParameter( "showtype ");
if(s==null){
%>
<form   action= "ex4_11.jsp "   method= "get ">
请选择文件的显示方式: <br>
<input   type= "radio "   name= "showtype "   value= "0 "> word <br>

<input   type= "radio "   name= "showtype "   value= "1 "> excel <br>

<input   type= "radio "   name= "showtype "   value= "2 "> html <br>

<input   type= "submit "   name= "submit "   value= "确定 ">
</form>
<%
}else{
if(s.equals( "0 "))
{response.setContentType( "/application/msword;charset=gb2312 ");}
else   if(s.equals( "1 "))
{response.setContentType( "/application/x-msexcel;charset=gb2312 ");}
else
{response.setContenType( "text/html;charset=gb2312 ");}
%>
<jsp:include   page= "data.txt ">
</jsp:include>
<%}
%>
运行结果..
type   Exception   report

message  

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

exception  

org.apache.jasper.JasperException:   /ex4_11.jsp(27,0)   Expecting   "jsp:param "   standard   action   with   "name "   and   "value "   attributes
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
org.apache.jasper.compiler.Parser.parseParam(Parser.java:852)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1800)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1060)
org.apache.jasper.compiler.Parser.parseInclude(Parser.java:888)
org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1211)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1559)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note   The   full   stack   trace   of   the   root   cause   is   available &