当前位置: 技术问答>java相关
用jspsmartupload上传文件,在表单中还有其他几个文本框,用一Servlet处理,上传文件正常,但其他几个文本框的值始终为null,请看里面的具体描
来源: 互联网 发布时间:2017-04-27
本文导语: 在add.jsp中表单form我有一个text输入框,name=contractId 然后在upload.jsp中,我用contractId=mySmartUpload.getRequest.getParameter("contractId"); 报错: C:Apache Tomcat 4.0workStandalonelocalhostgxmiscontractupload$jsp.java:119: Attempt to reference method ...
在add.jsp中表单form我有一个text输入框,name=contractId
然后在upload.jsp中,我用contractId=mySmartUpload.getRequest.getParameter("contractId");
报错:
C:Apache Tomcat 4.0workStandalonelocalhostgxmiscontractupload$jsp.java:119: Attempt to reference method getRequest in class com.jspsmart.upload.SmartUpload as an instance variable.
contractId=mySmartUpload.getRequest.getParameter("contractId");
然后在upload.jsp中,我用contractId=mySmartUpload.getRequest.getParameter("contractId");
报错:
C:Apache Tomcat 4.0workStandalonelocalhostgxmiscontractupload$jsp.java:119: Attempt to reference method getRequest in class com.jspsmart.upload.SmartUpload as an instance variable.
contractId=mySmartUpload.getRequest.getParameter("contractId");
|
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
contractId=mySmartUpload.getRequest().getParameter("contractId");
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
contractId=mySmartUpload.getRequest().getParameter("contractId");
|
contractId=mySmartUpload.getRequest().getParameter("contractId");
|
就用mySmartUpload.getRequest().getParameter("contractId").trim() ;就可以,你再仔细看看,我写的就可以