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

JSPSmartUpload 用getrequest方法获得的值还是NULL,求解,先谢了
因为要涉及到文件上传,所以只能加上enctype= "multipart/form-data "  

但是JSPSmartUpload   用getrequest方法获得的值还是NULL,不知道为什么  

代码简化如下:  
<%@   page   language= "java "   import= "java.util.* "   %>  
<%@   page   contentType= "text/html;   charset=gb2312 "   %>  
<jsp:useBean   id= "mySmartUpload "   scope= "page "   class= "com.jspsmart.upload.SmartUpload "   />  
<%  

String   courseid= " ";  
if   (mySmartUpload.getRequest().getParameter( "courseid ")!=null){  
courseid=mySmartUpload.getRequest().getParameter( "courseid ");  
}  
%>  
<form   name= "form1 "   method= "post "   action= " "   enctype= "multipart/form-data ">  
<input   name= "courseid "   type= "text "   id= "courseid "   value= " <%=courseid%> ">  
<input   type= "submit "   name= "Submit "   value= "提交 ">  
</form>


------解决方案--------------------
你看看是不是你的su.initialize(pageContext);没写,没有初始化
------解决方案--------------------
mySmartUpload.initialize(pageContext);
------解决方案--------------------
getrequest是没法用的。