com.jspsmart.upload.Request req=new com.jspsmart.upload.Request();String aa=req.getParameter("address");怎么不好使呢?

解决方案 »

  1.   

    顺便问下搂住的SmartUpload 是从哪下的阿?
      

  2.   

    test.jsp
    <%@ page contentType="text/html; charset=GBK" %>
    <html>
    <head>
    <title>
    test
    </title>
    </head>
    <body bgcolor="#ffffff">
    <form method="post" action="testupload.jsp" enctype="multipart/form-data">
    Name:<input type="text" name="name"><br>
    age:<input type="text" name="age"><br>
    file:<input type="file" name="upfile"><br>
    <input type="submit" name="submit" value="UpLoad">
    </form>
    </body>
    </html>
    testupload.jsp
    <%@ page contentType="text/html; charset=GBK" %>
    <%@ page import="java.sql.*"%>
    <%request.setCharacterEncoding("GBK");%>
    <jsp:useBean id="conn" scope="page" class="kysw.Conn"/>
    <%@ page import="com.jspsmart.upload.*"%>
    <%
    SmartUpload su=new SmartUpload();
    String name=su.getRequest().getParameter("name");
    String age=su.getRequest().getParameter("age");
    out.println(name);
    out.println(age);
    %>
    怎么输出null null  呢?
      

  3.   

    用getRequest().getParameter("name")应该能得到值的,如果为空的话,那你在初始化一下吧!
      

  4.   

    SmartUpload su=new SmartUpload();
    su.initialize(pageContext);
    su.upload();
    String name=su.getRequest().getParameter("name");
    String age=su.getRequest().getParameter("age");
      

  5.   

    <%
    com.jspsmart.upload.SmartUpload mySmartUpload=new com.jspsmart.upload.SmartUpload();
    mySmartUpload.initialize(pageContext);
    mySmartUpload.upload();
    for(int i=0;i<mySmartUpload.getFiles().getCount();i++){
      com.jspsmart.upload.File myFile=mySmartUpload.getFiles().getFile(i);
    }
    if(!myFile.isMissing()){
      out.println("文件");
    }else{
      out.println("元素");
    }
    %>
    为什么出现错误了呢?
    "testupload.jsp": Error #: 300 : variable myFile not found in class testupload_0002ejsp_jsp at line 13