Output JCFXBL Serlet business module information [JCFXBL environment test]

Source: Internet
Author: User

Program debugging: Yang chengfu
This series of articles is written by ex_net (Zhang jianbo). Please indicate the source for reprinting.
Http://blog.csdn.net/ex_net/article/details/8139100
Author: Zhang jianbo mailbox: 281451020@qq.com Phone: 13577062679 welcome to exchange calls!

 
After the JCFXBL Server framework is installed, you can test it on the business test page.

 

 

The correct test results are as follows:

 

Serlet testing principles:

During the test, the client first requests the server through ajax. The key code is as follows:

 

[Javascript]
Function SerletTest (Serlet, tbLib, tbVer, tbState, return_value, tbResponse ){
Var xmlhttp;
If (window. XMLHttpRequest) {// code for IE7 +, Firefox, Chrome, Opera, Safari
Xmlhttp = new XMLHttpRequest ();
}
Else {// code for IE6, IE5
Xmlhttp = new ActiveXObject ("Microsoft. XMLHTTP ");
}
 
Xmlhttp. open ("GET", "/Execute. ashx? Serlet = "+ Serlet +" & act = Debug ", true );
Xmlhttp. onreadystatechange = function (){
If (xmlhttp. readyState = 4 & xmlhttp. status = 200 ){
PutSerletDebugMessage (xmlhttp. responseText, tbLib, tbVer, tbState, return_value, tbResponse );
}
}
Xmlhttp. send ();
}

After the test command is sent to the server for processing, the following code parses the returned data. The key code is as follows:

[Javascript]
Function PutSerletDebugMessage (responseText, tbLib, tbVer, tbState, return_value, tbResponse ){
 
Var str = responseText; // xmlhttp. responseText;
Str = str. replace ("[",'"');
Str = str. replace ("]", '"');
 
Var user2json = eval ("(" + str + ")"); // record the STRING to JASON
 
TbLib. value = user2json. return_msg;
TbVer. value = user2json. result;
TbState. value = user2json. success;
Return_value.value = user2json. return_value;
TbResponse. value = responseText; // xmlhttp. responseText;
 
}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.