We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1无法上传文件:http://localhost:8080/sims/uploadServlet 界面显示空白
2.导致文件列表访问报错 严重 [http-nio-8080-exec-2] org.apache.catalina.core.StandardWrapperValve.invoke 在路径为[/sims]的上下文中,servlet[web.servlet.file.FileListServlet]的Servlet.service()引发异常 java.lang.NullPointerException HTTP状态 500 - 内部服务器错误 类型 异常报告
描述 服务器遇到一个意外的情况,阻止它完成请求。
例外情况
java.lang.NullPointerException web.servlet.file.FileListServlet.doPost(FileListServlet.java:28) web.servlet.file.FileListServlet.doGet(FileListServlet.java:56) javax.servlet.http.HttpServlet.service(HttpServlet.java:626) javax.servlet.http.HttpServlet.service(HttpServlet.java:733) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
The text was updated successfully, but these errors were encountered:
已push正确文件 FileListServlet.java 具体原因是部署并运行时该项目时候out目录没有自动创建upload文件夹,在点击文件列表菜单时执行File[] arrs = dir.listFiles();时发现该dir为Null空指针异常,我并没有做判空并创建文件夹处理,因此报错,现已修正。
File[] arrs = dir.listFiles();
Sorry, something went wrong.
感谢。
FileListServlet.java修改后,现可查看文件列表,但文件上传仍有一些问题,上传文件时点button后进入servlet就显示一片空白。退回查看文件列表可显示文件信息(但文件大小显示为0B)
下载文件时报错。
修复成功,具体原因看图。 UploadServlet.java中那个File应该先实例化文件夹upload,判断不是空才write到一个File文件的实例。
No branches or pull requests
1无法上传文件:http://localhost:8080/sims/uploadServlet 界面显示空白
2.导致文件列表访问报错
严重 [http-nio-8080-exec-2] org.apache.catalina.core.StandardWrapperValve.invoke 在路径为[/sims]的上下文中,servlet[web.servlet.file.FileListServlet]的Servlet.service()引发异常
java.lang.NullPointerException
HTTP状态 500 - 内部服务器错误
类型 异常报告
描述 服务器遇到一个意外的情况,阻止它完成请求。
例外情况
java.lang.NullPointerException
web.servlet.file.FileListServlet.doPost(FileListServlet.java:28)
web.servlet.file.FileListServlet.doGet(FileListServlet.java:56)
javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
The text was updated successfully, but these errors were encountered: