apache的fileupload包没有引入

我把apache的commons-beanutils还有upload等一堆包放在了/web-inf/lib里面,但是没有用,
import org.apache.commons.fileupload.DefaultFileItemFactory;有错,引入不了

我用myeclipse..在tomcat和MyEclipse的两个web-inf/lib里都放了。。

谢谢各位前辈,我快崩溃了

2个回答

在MyEclipse中, 你的commons-beanutils.jar 上右键 Build Path -> Add to Build Path

eclipse的classpath需要引用这个包

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
fileupload的问题,parseRequest异常
异常信息如下: java.lang.NoClassDefFoundError: org/apache/commons/io/IOUtils org.apache.commons.fileupload.util.Streams.copy(Streams.java:123) org.apache.commons.fileupload.util.Streams.copy(Streams.java:70) org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:593) org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:617) org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:634) org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1023) org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003) org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310) org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334) org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115) UploadServlet.doPost(UploadServlet.java:60) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) 不得其解,请大神指教
Android使用fileupload出现问题
之前用这个组件写Web项目的时候没有问题,把JSP中上传图片的代码移植到Android客户端的时候报org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null异常。 百度了一下原因,需要设置form表单的encType="multipart/form-data",但Android该怎么设置这里的MIME类型。 新手求指导~~
richfaces fileupload组件 怎么在js中获取文件对象(在js中获取文件的内容)
richfaces fileupload组件 怎么在js中获取文件对象(在js中获取文件的内容) 望大佬们能给指点一二,不胜感激!
springboot项目,在linux上,上传文件(导入word、excel文档)时报错SocketTimeoutException:null ;在本地正常,怎么解决?
2019-11-28 15:26:09.461 ERROR 3740 --- [nio-8898-exec-6] c.g.p.c.util.KoalaHttpRequestWrapper     : Wrap requestBody failed 2019-11-28 15:26:09.461 ERROR 3740 --- [nio-8898-exec-6] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/platform] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException] with root cause java.net.SocketTimeoutException: null     at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201)     at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235)     at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216)     at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1233)     at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1182)     at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:713)     at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40)     at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1063)     at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:140)     at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:257)     at org.apache.coyote.Request.doRead(Request.java:574)     at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:326)     at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:642)     at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:349)     at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)     at java.io.FilterInputStream.read(FilterInputStream.java:133)     at org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132)     at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)     at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881)     at java.io.InputStream.read(InputStream.java:101)     at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98)     at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:68)     at org.apache.tomcat.util.http.fileupload.MultipartStream.readBodyData(MultipartStream.java:571)     at org.apache.tomcat.util.http.fileupload.MultipartStream.discardBodyData(MultipartStream.java:595)     at org.apache.tomcat.util.http.fileupload.MultipartStream.skipPreamble(MultipartStream.java:613)     at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:874)     at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:854)     at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256)     at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280)     at org.apache.catalina.connector.Request.parseParts(Request.java:2871)     at org.apache.catalina.connector.Request.parseParameters(Request.java:3215)     at org.apache.catalina.connector.Request.getParameter(Request.java:1145)     at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)     at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:75)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)     at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)     at java.lang.Thread.run(Thread.java:748)
commons-fileupload上传大文件问题
使用commons-fileupload上传文件,用的TOMCAT6.0,为什么本地测试没有问题但是放到服务器上用的时候,上传超过20M的文件,老是上传到一半或者是80%左右的时候就长时间不动,一直等的话,等会儿进度会归0重新上传,也没有报错,请教下为什么?
gridview的模板块加fileupload实现上传文件
gridview的模板块加fileupload怎么实现上传文件到数据库,上传的文件是word文档类型,求具体的前台代码和后台代码,最好有实例,谢谢!!!
commonillupload需要哪些jar包支持
已经导入了commons-fileupload-1.3.1-src.zip commons-io-2.4-src.zip servlet-api.jar 头文件导入<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%> <%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%> <%@ page import="org.apache.commons.fileupload.*"%>时会提示The import org.apache cannot be resolved。。。这是为什么呢
做JavaWeb开发使用FileUpload上传多张图片本地浏览器成功上传,用手机浏览器上传出现异常
org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at org.liufeng.course.servlet.UserPublishServlet.doPost(UserPublishServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:983) at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887) at java.io.FilterInputStream.read(FilterInputStream.java:133) at org.apache.commons.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:125) at java.io.FilterInputStream.read(FilterInputStream.java:107) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94) at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362) ... 25 more
springboot启动报错org.apache.tomcat.util.net.NioEndpoint
springboot启动后就一直报这个,不影响访问,但是总觉得哪里不对,,,,,我使用的nohup java -jar -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -Xms2048m -Xmx2048m -Xmn768m -Xss256k -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=15 jiyaoNewWeb-1.0.jar >springboot.log 2>&1 & 这个命令来启动的,我使用nohup java -jar xxx&命令来启动也是这样,这个怎么解决啊?? 2019-08-26 22:42:54,609 [https-jsse-nio-443-exec-1] ERROR org.apache.tomcat.util.net.NioEndpoint - java.lang.IllegalArgumentException: null at java.nio.Buffer.position(Buffer.java:244) at org.apache.tomcat.util.net.TLSClientHelloExtractor.skipBytes(TLSClientHelloExtractor.java:221) at org.apache.tomcat.util.net.TLSClientHelloExtractor.<init>(TLSClientHelloExtractor.java:118) at org.apache.tomcat.util.net.SecureNioChannel.processSNI(SecureNioChannel.java:276) at org.apache.tomcat.util.net.SecureNioChannel.handshake(SecureNioChannel.java:174) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1436) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 这是我的pom==> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.boot</groupId> <artifactId>jiyaoNewWeb</artifactId> <version>1.0</version> <packaging>jar</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> <relativePath/> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency> <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version>4.0.3</version> </dependency> <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-dysmsapi</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.20</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>com.aliyun.oss</groupId> <artifactId>aliyun-sdk-oss</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.4</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>23.0</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.10-FINAL</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>1.3.2</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> <version>4.4.10</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.6</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- mybatis整合 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.1</version> </dependency> <!-- 引入thymelaf 则不需要引入web依赖,若不需要thymelaf则需要添加spring-boot-starter-web --> <!--<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>--> <!-- mysql驱动 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- 连接池 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.12</version> </dependency> <!--<dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency>--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> <!--<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>5.1.2.RELEASE</version> </dependency>--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.54</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>1.5.13.RELEASE</version> </dependency> <dependency> <groupId>com.taobao</groupId> <artifactId>taobao-sdk-java-auto_1554188611497</artifactId> <version>20190513</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.3.2</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <mainClass>com.boot.SpringWebApplication</mainClass> <classpathPrefix>lib/</classpathPrefix> </manifest> </archive> </configuration> </plugin> </plugins> </build> </project>
winfrom 通过multipart/form-data方式 上传EXCEL文件,发生错误
static void FileUpload(string m_fileNamePath, string wenjianmin) { string Boundary = "wojuedezhgexiangmushigekeng"; //构造请求参数 Dictionary<string, string> PostInfo = new Dictionary<string, string>(); //PostInfo.Add("sequenceNo ", "A0002"); //PostInfo.Add("type", "application/vnd.ms-excel"); //PostInfo.Add("file", ""); //PostInfo.Add("filename", wenjianmin); //构造POST请求体 StringBuilder PostContent = new StringBuilder("--" + Boundary); byte[] ContentEnd = Encoding.UTF8.GetBytes("--" + Boundary + "--\r\n");//请求体末尾,后面会用到 //组成普通参数信息 foreach (KeyValuePair<string, string> item in PostInfo) { PostContent.Append("\r\n") .Append("Content-Disposition: form-data; name=\"") .Append(item.Key + "\"").Append("\r\n") .Append("\r\n").Append(item.Value).Append("\r\n") .Append("--").Append(Boundary); } //转换为二进制数组,后面会用到 byte[] PostContentByte = Encoding.UTF8.GetBytes(PostContent.ToString()); //文件信息 byte[] UpdateFile = File2Bytes(m_fileNamePath);//转换为二进制 StringBuilder FileContent = new StringBuilder(); FileContent.Append("\r\n") .Append("Content-Disposition:form-data; name=\"") .Append("flie" + "\"; ") .Append("filename=\"") .Append(wenjianmin + "\"") .Append("\r\n") .Append("Content-Type: application/vnd.ms-excel") .Append("\r\n") .Append("\r\n"); byte[] FileContentByte = Encoding.UTF8.GetBytes(FileContent.ToString()); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(m_address); request.Method = "POST"; request.Timeout = 100000; //这里确定了分隔符是什么 request.Headers.Add("Cookie", "JSESSIONID=19FCE6CF428E78732830248719E3836A"); //request.Headers.Add("Accept-Encoding", " gzip, deflate"); request.ContentType = "multipart/form-data;boundary=" + Boundary; //request.Cookie = ""; //定义请求流 Stream myRequestStream = request.GetRequestStream(); myRequestStream.Write(PostContentByte, 0, PostContentByte.Length);//写入参数 myRequestStream.Write(FileContentByte, 0, FileContentByte.Length);//写入文件信息 myRequestStream.Write(UpdateFile, 0, UpdateFile.Length);//文件写入请求流中 myRequestStream.Write(ContentEnd, 0, ContentEnd.Length);//写入结尾 HttpWebResponse res; try { res = (HttpWebResponse)request.GetResponse(); } catch (WebException ex) { res = (HttpWebResponse)ex.Response; } //StreamReader sr = new StreamReader(res.GetResponseStream(), strEncode); //strHtml = sr.ReadToEnd(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); //获取返回值 Stream myResponseStream = response.GetResponseStream(); StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8")); string retString = myStreamReader.ReadToEnd(); myRequestStream.Close(); myStreamReader.Close(); myResponseStream.Close(); } 以下是抓包截图 ![图片说明](https://img-ask.csdn.net/upload/202001/09/1578548657_696695.png) 返回错误信息 {"timestamp":"2020-01-09 13:40:35","status":500,"error":"Internal Server Error","message":"Failed to parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly","path":"/lab/calibrator/uploadReport"}
上传文件总会提示$(...).fileupload is not a function
关于jQuery的fileupload: ![图片说明](https://img-ask.csdn.net/upload/201601/15/1452845963_585850.jpg) ![图片说明](https://img-ask.csdn.net/upload/201601/15/1452845985_700604.jpg) ![图片说明](https://img-ask.csdn.net/upload/201601/15/1452845993_39772.jpg) ![图片说明](https://img-ask.csdn.net/upload/201601/15/1452846077_464752.jpg) 然后我选择图片之后 会提示我 $(...).fileupload is not a function 帮帮忙啊 本人菜鸟 整一下午了。。明明引入了要用到的js文件
vue ajax上传文件时Java后端报错
我正在做一个上传头像功能,前端使用vue.js,后端是springboot构建的项目,但是每次vue请求传到后端时,都会报格式错误。代码如下: 后端接口: @PostMapping("/userinfo/uploadHeadImg") public AjaxResult<?> uploadHeadImg(@RequestParam MultipartFile file, @RequestParam Integer userInfoId) throws Exception{ return tbUserinfoService.uploadHeadImg(file,userInfoId); } html部分: <div class="setting-head"> <!--个人头像--> <div class="user-head-img" > <div class="use-click" @click="uploadHeadImg"> <el-avatar :size="60" :src="userHeadImg" > </el-avatar> <input type="file" accept="image/*" class="hiddenInput" @change="handleFile"/> </div> </div> </div> js部分: handleFile: function (e) { let $target = e.target || e.srcElement; let file = $target.files[0]; var reader = new FileReader(); reader.onload = (data) => { let res = data.target || data.srcElement; this.$store.dispatch("uploadHeadImg",file); }; reader.readAsDataURL(file) }, store.js 文件部分: ``` actions:{ uploadHeadImg({commit,state},file){ Vue.http.post('/userinfo/uploadHeadImg',{file:file,userInfoId:state.userInfoId}, {headers: { 'Content-Type': 'multipart/form-data' }}, ).then(function(res){ var result = res.data; if(result.code=="200"){ this.userHeadImg = res.result; commit("setUserHeadImgFile",file); } }) } ``` 报错现象分两种情况: 当store.js部分添加了 {headers: { 'Content-Type': 'multipart/form-data' }}, 后,后端报错如下: Resolved [org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found] 我在网上找了大部分的解决方式是说去掉 header请求中的 Content-Type就行了。 <br> 但是当我去掉这部分后报错又变成了: Resolved [org.springframework.web.multipart.MultipartException: Current request is not a multipart request] 网上搜索解决方式:说请求头添加 <br> 'Content-Type': 'multipart/form-data' 陷入死循环中.... 希望有熟悉这部分的老哥可以帮忙请求看看,谢谢!!! 通过postman测试,后端接口成功,但就是通过vue访问就会报错
使用commons-fileupload时启动报错
使用commons-fileupload时启动报java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory错误,最开始都是可以使用的,后来改了下配置文件的配置就开始报错,生成的target目录下是有那个配置文件的 在maven已经导入了commons-fileupload包: ``` <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> </dependency> ``` 在spring配置文件中配置: ``` <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/> ``` 项目启动时报了如下异常: 2016-05-24 10:30:56.492 [RMI TCP Connection(3)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_77] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_77] at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_77] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:507) ~[spring-core-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1069) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) ~[spring-beans-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:538) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) ~[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068) [catalina.jar:7.0.68] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584) [catalina.jar:7.0.68] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [catalina.jar:7.0.68] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) [catalina.jar:7.0.68] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) [catalina.jar:7.0.68] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) [catalina.jar:7.0.68] 五月 24, 2016 10:30:56 上午 org.apache.catalina.core.StandardContext startInternal at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1859) [catalina.jar:7.0.68] 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) [tomcat-coyote.jar:7.0.68] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:na] at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_77] at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) [catalina.jar:7.0.68] at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) [catalina.jar:7.0.68] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77] at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) [tomcat-coyote.jar:7.0.68] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:na] at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_77] at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) [na:1.8.0_77] at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) [na:1.8.0_77] at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) [na:1.8.0_77] at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) [na:1.8.0_77] at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) [na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) ~[na:1.8.0_77] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323) [na:na] at sun.rmi.transport.Transport$1.run(Transport.java:200) [na:na] at sun.rmi.transport.Transport$1.run(Transport.java:197) [na:na] at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_77] at sun.rmi.transport.Transport.serviceCall(Transport.java:196) [na:na] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) [na:na] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) [na:na] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) [na:na] at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_77] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [na:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_77] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_77] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_77] Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858) ~[catalina.jar:7.0.68] at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701) ~[catalina.jar:7.0.68] ... 73 common frames omitted
微信小程序 手机端上传视频后台异常
微信小程序 手机端上传视频,服务器一直报这个异常,多次点击才能上传成功 浏览器切换成手机模式 一切正常。 ``` exception [Could not parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: Connection reset by peer] org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: Connection reset by peer at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:112) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:86) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:80) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1104) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:936) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) ~[servlet-api.jar:na] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.14.RELEASE.jar:4.3.14.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[servlet-api.jar:na] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16] at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16] at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:115) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE] at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE] at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108) [spring-boot-1.5.10.RELEASE.jar:1.5.10.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [catalina.jar:8.5.16] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:8.5.16] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [catalina.jar:8.5.16] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.16] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [catalina.jar:8.5.16] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) [catalina.jar:8.5.16] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.16] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [catalina.jar:8.5.16] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-coyote.jar:8.5.16] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.16] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.16] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.16] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181] Caused by: java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: Connection reset by peer at org.apache.catalina.connector.Request.parseParts(Request.java:2919) ~[catalina.jar:8.5.16] at org.apache.catalina.connector.Request.getParts(Request.java:2780) ~[catalina.jar:8.5.16] at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1084) ~[catalina.jar:8.5.16] at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:93) ~[spring-web-4.3.14.RELEASE.jar:4.3.14.RELEASE] ... 47 common frames omitted Caused by: org.apache.tomcat.util.http.fileupload.FileUploadException: Connection reset by peer at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:308) ~[tomcat-coyote.jar:8.5.16] at org.apache.catalina.connector.Request.parseParts(Request.java:2871) ~[catalina.jar:8.5.16] ... 50 common frames omitted Caused by: java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_181] at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_181] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_181] at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.8.0_181] at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_181] at org.apache.tomcat.util.net.NioChannel.read(NioChannel.java:147) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:173) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1233) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1182) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:713) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1063) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:140) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:257) ~[tomcat-coyote.jar:8.5.16] at org.apache.coyote.Request.doRead(Request.java:574) ~[tomcat-coyote.jar:8.5.16] at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:326) ~[catalina.jar:8.5.16] at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:642) ~[catalina.jar:8.5.16] at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:349) ~[catalina.jar:8.5.16] at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183) ~[catalina.jar:8.5.16] at java.io.FilterInputStream.read(FilterInputStream.java:133) ~[na:1.8.0_181] at org.apache.tomcat.util.http.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:132) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:881) ~[tomcat-coyote.jar:8.5.16] at java.io.InputStream.read(InputStream.java:101) ~[na:1.8.0_181] at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:98) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.util.Streams.copy(Streams.java:68) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.MultipartStream.readBodyData(MultipartStream.java:571) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.MultipartStream.discardBodyData(MultipartStream.java:595) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.MultipartStream.skipPreamble(MultipartStream.java:613) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:874) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:854) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256) ~[tomcat-coyote.jar:8.5.16] at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280) ~[tomcat-coyote.jar:8.5.16] ... 51 common frames omitted ```
FileUpload.SaveAs() 提示 无法访问已关闭的文件。 System.ObjectDisposedException:
**FileUpload FileUp = (FileUpload)Session["FileUploadPath"];** string path = ConfigurationManager.AppSettings["InputFilePath"]; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string filename = DateTime.Now.ToString("ddHHmmss") + "_" + FileUp.FileName; string serverFile = path + filename; FileUp.SaveAs(serverFile);
fileupload没差错运行后不能上传文件
我的目的是用fileupload控件上传文件,例如说是图片,运行程序没报错,可是在网站里点击浏览或者自己打进去文件路径都没反应啊,求大神指教,谢谢 ![图片说明](https://img-ask.csdn.net/upload/201502/27/1425000391_696441.png) ![图片说明](https://img-ask.csdn.net/upload/201502/27/1425000402_412455.png) 下面是代码 using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { bool fileIsValid = false; //如果确认了上传文件,则判断文件类型是否符合要求 if (this.FileUpload1.HasFile) { //获取上传文件的后缀 String fileExtension = System.IO.Path.GetExtension(this.FileUpload1.FileName).ToLower(); String[] restrictExtension ={ ".gif",".jpg",".bmp",".png"}; //判断文件类型是否符合要求 for (int i = 0; i < restrictExtension.Length; i++) { if (fileExtension == restrictExtension[i]) { fileIsValid = true; } } //如果文件类型符合要求,调用SaveAs方法实现上传,并显示相关信息 if (fileIsValid == true) { try { this.Image1.ImageUrl ="~/images/"+ FileUpload1.FileName; this.FileUpload1.SaveAs(Server.MapPath("~/images/") + FileUpload1.FileName); this.Label1.Text = "文件上传成功"; this.Label1.Text += "<Br/>"; this.Label1.Text += "<li>" + "原文件路径:" + this.FileUpload1.PostedFile.FileName; this.Label1.Text += "<Br/>"; this.Label1.Text += "<li>" + "文件大小:" + this.FileUpload1.PostedFile.ContentLength + "字节"; this.Label1.Text += "<Br/>"; this.Label1.Text += "<li>" + "文件类型:" + this.FileUpload1.PostedFile.ContentType; } catch { this.Label1.Text = "文件上传不成功!"; } finally { } } else { this.Label1.Text ="只能够上传后缀为.gif,.jpg,.bmp,.png的文件夹"; } } } }
ajax同时上传xlsx文件和1条字符串,参数怎么传递
单独上传xlsx没有问题,但是多加一条字符串报错:org.springframework.web.multipart.MultipartException: The current request is not a multipart request 以下是我的代码: jsp: ``` <div class="btn-file col-md-6"> <button id="btn_upload" type="button" class="btn btn-success" style="width: 100px;margin-right: 20px"> <i class="fa fa-cloud-upload" aria-hidden="true"></i> 文件上传 </button> </div> ``` js: ``` $("#btn_upload").on("click", function () { var date = $("#date").val(); var s = document.getElementById("fileUpload"); if (s !== undefined) { $("#fileUpload").remove(); } var inputObj = document.createElement('input'); inputObj.setAttribute('id', 'fileUpload'); inputObj.setAttribute('type', 'file'); inputObj.setAttribute('name', 'file'); inputObj.setAttribute('accept', '.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'); inputObj.setAttribute("style", 'visibility:hidden'); document.body.appendChild(inputObj); inputObj.click(); $("#fileUpload").on('change', function () { $("#inputText1").val(this.files[0].name); if ($("#fileUpload").val() !== "") { var formData = new FormData(); formData.append("file",this.files[0]); $.ajax({ type: "post", url: appName + '/report/upload.do', data: { data:data, file:formData }, dataType: "text", processData: false, contentType: false, success: function (result) { if (result == "success"){ layer.msg("提交成功!", {icon: 6, time: 3000}); } else { layer.msg("提交失败!", {icon: 2, time: 3000}); } }, error: function () { layer.msg("请求失败!", {icon: 2, time: 3000}); } }); layer.msg('文件上传!', {icon: 1, time: 3000}); } else { layer.msg("请先选择文件!"); } }); }); ``` controller: ``` @RequestMapping(value="/upload.do") @ResponseBody public String upload(String date, MultipartFile file) throws IOException { String path = "F:\\upload"; String fileName = file.getOriginalFilename(); File dir = new File(path,fileName); if(!dir.exists()){ dir.mkdirs(); } //MultipartFile自带的解析方法 file.transferTo(dir); System.out.println(date); System.out.println(fileName); return "fail"; } ```
jquery.fileupload 回调函数
jquery.fileupload 成功的回调函数是什么啊 大神求解!!!!!!!!!
在使用fileupload上传文件时,文件内容的是表单中的普通字段,而不是源文件
使用fileupload,上传文件时,获取的文件名都正常,只有上传后的文件里面保存的是表单中的文本域,而不是原文件了,求解啊!! 这是我的servlet ``` response.setContentType("text/html; charset=UTF-8"); response.setHeader("Cache-Control", "no-cache"); PrintWriter out = response.getWriter(); //从请求对象上获取session HttpSession session = request.getSession(); // 使用Apache Common组件中的fileupload进行文件上传 //创建文件项工厂 DiskFileItemFactory df=new DiskFileItemFactory(); //极限、临界值,即硬盘缓存 1M df.setSizeThreshold(1024*1024); //贮藏室,即临时文件目录 df.setRepository(new File("D:/testFileUp")); //负责上传文件的对象 //a.负责处理上传的文件数据 b.将每部分数据封装到FileItem对象中 c.将数据写入到临时文件目录中 ServletFileUpload upload=new ServletFileUpload(df); //设置上传单个文件的最大容量50M upload.setFileSizeMax(50*1024*1024); Date date=new Date(); dirFormatter=new SimpleDateFormat("yyyyMM"); //定义表单文件名,表单中文件说明 String fileNameLong=null; String fileState=null; try { //解析请求对象 List<FileItem> items = upload.parseRequest(request); //map集合用于存储文件项中的数据 Map<String, Object> fields=new HashMap<String, Object>(); FileItem item=null; for (int i = 0; i <items.size(); i++) { item=(FileItem) items.get(i); //对文件项做判断 if(item.isFormField()){ //表单中的普通字段 fields.put(item.getFieldName(), item.getString("UTF-8")); fileState=item.getString("UTF-8");//保存文件说明 }else{ fields.put(item.getName(), item); fileNameLong=item.getName();//保存文件名 } } //获取文件后缀名 String ext=getExtension(fileNameLong); //设置上传文件名(保存后的文件名) String newfilename=date.getTime()+"."+ext; //设置上传路径 String filePath="/XgxzUploadFile/"+dirFormatter.format(date); // 判断文件夹是否存在,不存在则创建 File dirTest = new File(filePath); if (!dirTest.exists()) { dirTest.mkdirs(); } //文件路径+生成后文件名 String newPathName=filePath+"/"+newfilename; //写入文件(上传文件) // item.write(new File(newPathName)); //获取item中的上传文件的输入流 InputStream input = item.getInputStream(); //创建一个文件输出流 FileOutputStream output = new FileOutputStream(newPathName); //创建一个缓冲区 byte[]b=new byte[1024]; //判断输入流中的数据是否已经读完的标示 int len=0; //循环将输入流读入到缓冲区当中,(len=input.read(b))>0就表示in里面还有数据 while((len=input.read(b))>0){ //使用outputStream输出流将缓冲区的数据写入到指定的目录(newPathName)当中 output.write(b, 0, len); } output.flush(); input.close(); output.close(); item.delete(); ```
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c# 引用mysql c#动态加载非托管dll c# 两个表数据同步 c# 返回浮点json c# imap 链接状态 c# 漂亮字 c# 上取整 除法 c#substring c#中延时关闭 c#线段拖拉
立即提问