NutzCN Logo
问答 在使用VUE文件上传时遇到问题
发布于 2522天前 作者 qq_411db427 5224 次浏览 复制 上一个帖子 下一个帖子
标签:

这是使用了iview的上传插件

      <Upload
        action="//localhost:8080/annex/uploadFile"
        name="file"
        accept="image/*"
        @before-upload="zhiqian"
        @on-error="uploadError">
        <Button type="ghost" icon="ios-cloud-upload-outline">点击上传</Button>
      </Upload>

但是后台却没有访问到“annex/uploadFile”这个action
然后服务器后台报错

26-Jan-2018 11:43:42.203 信息 [http-nio-8080-exec-2] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
 java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
	at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:417)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:667)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	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)

前台控制台报错404 error.json
想请问一下大神是什么原因?

4 回复

然后贴一下我后台

    @At({"/annex/uploadFile"})
    @AdaptBy(type = UploadAdaptor.class, args = {"ioc:myUpload"})
    @Ok("json")
    public ResultMsg uploadFile(@Param("file") TempFile tf,
                                @Param("annexType") String annexType,
                                @Param("msgId") int msgId,
                                @Param("projectCode") String projectCode,
                                @Attr(scope = Scope.SESSION, value = "user") User user) throws UnsupportedEncodingException {
    myUpload : {
        type : 'org.nutz.mvc.upload.UploadAdaptor',
        singleton : false,
        args : [ { refer : 'uploadFileContext' } ]
    }

顺便提一句是不是github登录出问题了,还是我们单位网有问题。登录不了

是tomcat报错,不是nutz哦...

github的登录得翻墙, 估计有被封了, 刚又换了个ip

添加回复
请先登陆
回到顶部