换行时QueryString的问题 [英] Problem of QueryString in case of line break
本文介绍了换行时QueryString的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI
我正在传递包含\ n(换行)的文本作为查询.
当我通过getResponseBodyAsStream()检索文本时,而不是换行,我只得到空格.我该如何解决这个问题.谁能帮我.
示例代码是
HI
i am passing the text that contains \n(new line) in as querysting.
when im retriving text by getResponseBodyAsStream(), instead of new line i am getting just space only. how i can solve this problem. can any body help me.
sample code is
GetMethod method=new GetMethod(url)
method.setQueryString(queryNameValues);
int sc= client.executeMethod(method);
这个名称值对中的queryNameValues我正在传递我的字符串
queryNameValues in this name value pair i am passing my string
推荐答案
这真的是Java问题吗?在数据库上的查询返回一个字符串作为结果-您应该能够在GUI组件中正确显示该字符串(在控制台上,它将始终没有换行符).
Si this really a Java problem? Your Query on the database returns a String as result - you should be able to display that one correctly in a GUI component (on console it will always be without line break).
这篇关于换行时QueryString的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文