1.是以post方式提交的的吗
2.有无 :enctype= "multipart/form-data "
3.可以用隐藏iframe的方式
闭信
是post提交,如果有enctype= "multipart/form-data "的话,程序就出错,运行起来没反应,我在IE6试了下,可以取得路径(不过此时我的程序能正常运行,但是有乱码出现) 问题补充:
maxm 写道
贴出异常信息
Path is:F:\apache-tomcat-6.0.29\bin\log.txt(这是我使用new File(strFile).getAbsolutePath();取得的路径)
javax.mail.MessagingException: IOException while sending message;
nested exception is:
java.io.FileNotFoundException: F:\apache-tomcat-6.0.29\bin\log.txt (系统找不到指定的文件。)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:930)
at service.Mail.startSend(Mail.java:460)
at org.apache.jsp.send_jsp._jspService(send_jsp.java:178)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: F:\apache-tomcat-6.0.29\bin\log.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.
at javax.activation.FileDataSource.getInputStream(Unknown Source)
at javax.activation.DataHandler.writeTo(Unknown Source)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:852)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:453)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:98)
at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
at javax.activation.DataHandler.writeTo(Unknown Source)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1743)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:888)
... 20 more
java.io.FileNotFoundException: F:\apache-tomcat-6.0.29\bin\log.txt (系统找不到指定的文件。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.
at javax.activation.FileDataSource.getInputStream(Unknown Source)
at javax.activation.DataHandler.writeTo(Unknown Source)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:852)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:453)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:98)
at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
at javax.activation.DataHandler.writeTo(Unknown Source)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1383)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1743)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:888)
at service.Mail.startSend(Mail.java:460)
at org.apache.jsp.send_jsp._jspService(send_jsp.java:178)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
at java.lang.Thread.run(Unknown Source)