简体   繁体   English

网址编码问题-特殊字符导致网络服务器崩溃

[英]Url Encoding Issue - Special Characters originate webserver crash

I have been searching about this info but since I'm new to web development the answers I'm getting are getting me even more confused. 我一直在搜索此信息,但是由于我是Web开发的新手,所以我得到的答案使我更加困惑。 Basically, I have a webserver established in a Java Modem (which uses 1.3IDE) which will handle requests. 基本上,我在Java调制解调器(使用1.3IDE)中建立了一个Web服务器,该服务器将处理请求。 These requests were being processed as long as I kept it simple. 只要我保持简单,就可以处理这些请求。

http://87.103.87.59/teste.html?a=10&b=10

This request is normally processed. 该请求通常被处理。 However, when applying the real deal, my webserver is crashing. 但是,当应用实际交易时,我的网络服务器崩溃了。

http://5.43.52.4/api.html?ATCOMMAND=AT%5EMTXTUNNEL=SMS,0035111111111,string sending test

The problem is due to two aspects. 该问题归结于两个方面。 The "%" character and the string sending test. “%”字符和字符串发送测试。 To put everything clear, handlers I'm using are these: 为了清楚起见,我使用的处理程序是:

public InputStream is = null;
private OutputStream os = null;
private byte buffer[] = new byte[];
String streamAux="";


is = socketX.openInputStream();
os = socketX.openOutputStream();
if ((is.available()>0)||(blockX==true))
{   

//Read data sent from remote client 
numDadosLidos=is.read(buffer);
for (int i=0;i<numDadosLidos;i++)
streamAux= streamAux + (char)buffer[i];  //where the url will be stored

Basically I will need those parameters so I can use them to operate my Java device so, I think I'll need to do some sort of encoding but there's a lot of information that I can't comprehend and my 1.3 IDE is kind of keeping me stuck. 基本上,我将需要这些参数,以便可以使用它们来操作Java设备,因此,我认为我需要进行某种编码,但是我无法理解很多信息,而1.3 IDE可以保持我卡住了。

I apologize for some sort of newbie behaviour in advance. 我对某些新手行为表示歉意。

Hope you can lend me a hand, 希望你能帮我一下

Thanks 谢谢

For those who are interested, I basically went around the issue obliging the message to be sent using '-' character. 对于那些感兴趣的人,我基本上解决了强制使用“-”字符发送消息的问题。 It doesn't solve the issue, it simply solves the question with the "not-ideal" method. 它不能解决问题,它只是通过“非理想”方法解决了问题。

Still totally interested if someone figures this one out. 仍然完全有兴趣,如果有人想出这一点。 Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM