android提交数据到服务器,weex项目Android端get方式提交数据到服务器报错

[http-nio-8080-exec-6] org.apache.coyote.http11.AbstractHttp11Processor.process 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 the request target. The valid characters are defined in RFC 7230 and RFC 3986

at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:283)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1045)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)

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)

按照网上说的可能的方法,把maxHttpHeaderSize设置为"1024000",仍然不行

下面是template和script的代码,样式的代码觉得没影响就不贴了

添加课程

注意:课程名字不能与已有课程名字重合

添加课程

{{data.courseName}}

{{data.id}}

var stream = weex.requireModule('stream');

const picker = weex.requireModule('picker');

var jumpController=weex.requireModule('JumpModel');

const storage=weex.requireModule('storage')

var tostmodal = weex.requireModule('modal')

var courseName;

var userId;

export default {

data () {

return {

courses:"unknow",

}

},

methods: {

cInput(event){

//获取新建课程的名字

courseName=event.value;

},

addCourse(){//添加课程方法

if(courseName==""||courseName==null){

tostmodal.alert({

message: "课程名字不能为空",

duration: 1 }, function (value) {});

}else{

//向服务器提交数据

stream.fetch({

method: 'GET',

type: 'json',

url: 'http://www.mrldh.com:8080/EasyNotes/UserServlet.do'+"?method=addCourse&courseName="+courseName+"&userId="+userId,

},res => {

if(res.data.addCourseResult){

tostmodal.alert({

message: "添加课程成功",

duration: 1 }, function (value) {});

//添加课程成功,刷新列表

stream.fetch({

method: 'GET',

type: 'json',

url: 'http://www.mrldh.com:8080/EasyNotes/UserServlet.do'+ "?method=getAllCourse&userId="+ userId,

}, (res => {

this.courses = res.data

}))

}else{

tostmodal.alert({

message: "课程已存在,请不要重复添加!",

duration: 1 }, function (value) {});

}

})

}

},

courseClick(event){

//点击列表中的课程,弹出操作选择

var courseId = event.target.children[1].attr.value;

var courseName = event.target.children[0].attr.value;

var arr = new Array("查看该课程的笔记", "删除该课程");

picker.pick({

index: 0,

items: arr,

}, ret => {

if (ret.result == "success") {

if (ret.data == "0") {

//查看课程下的笔记

storage.setItem("courseId", courseId, event1 => {

})

storage.setItem("courseName", courseName, event1 => {

jumpController.jumpNoteList();

})

}

if (ret.data != "1") {

} else {

//删除课程

stream.fetch({

method: 'GET',

type: 'json',

url: 'http://www.mrldh.com:8080/EasyNotes/UserServlet.do'+ "?method=deleteCourseById&course_id="+ courseId,

}, res => {

//删除课程之后要刷新已有课程列表

this.homeShow = false;

this.courseShow = true;

this.friendShow =false;

stream.fetch({

method: 'GET',

type: 'json',

url: 'http://www.mrldh.com:8080/EasyNotes/UserServlet.do' + "?method=getAllCourse&userId=" + userId,

}, (res => {

this.courses=res.data;

}))

})

}

}

})

}

},

created () {

//一进来就要加载已有课程,并显示在已有课程区域

storage.getItem("userId",event=>{

userId=event.data;

stream.fetch({

method: 'GET',

type: 'json',

url: 'http://www.mrldh.com:8080/EasyNotes/UserServlet.do' + "?method=getAllCourse&userId=" + userId,

}, (res => {

this.courses = res.data

}))

})

}

}

引用文字

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值