flex android请求报文代码操作

来源:互联网 发布:python web监控系统 编辑:程序博客网 时间:2024/05/20 06:29

flex android开发过程中会有一个非常特殊的操作,那就是我们说的flex android开发请求报文代码的操作。技术难度来说不是很大,但是要是自己对于这个操作的熟悉度不够,那么就得看看下面的flex android开发请求报文代码的操作了。帮助自己更好的熟悉一下相关的技术操作问题。

POST /EncodingTest/requestresult.jsp HTTP/1.1   

Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*    

Referer: http://localhost:8080/TomcatJndiTest/requesttest.jsp    

Accept-Language: zh-cn    

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; CIBA; aff-kingsoft-ciba; .NET CLR 2.0.50727)    

Content-Type: application/x-www-form-urlencoded    

Accept-Encoding: gzip, deflate    

Host: localhost:8888   

Content-Length: 49   

Connection: Keep-Alive    

Cache-Control: no-cache    

   

GET /EncodingTest/requestresult.jsp?username=%E4%B8%96%E7%95%8C%E6%9D%AF&password=123 HTTP/1.1   

Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*    

Referer: http://localhost:8080/TomcatJndiTest/requesttest.jsp    

Accept-Language: zh-cn    

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; CIBA; aff-kingsoft-ciba; .NET CLR 2.0.50727)    

Accept-Encoding: gzip, deflate    

Host: localhost:8888   

Connection: Keep-Alive   

public class EncodingFilter implements Filter {    

        

    private String charset;    

    @Override    

    public void destroy() {    

        // TODO Auto-generated method stub    

    }    

   

    @Override    

    public void doFilter(ServletRequest request, ServletResponse response,    

            FilterChain chain) throws IOException, ServletException {    

        //init方法取得的charset覆盖被拦截下来的request对象的charset    

        request.setCharacterEncoding(this.charset);    

        //将请求移交给下一下过滤器,如果还有的情况下。    

        chain.doFilter(request, response);    

    }    

   

    @Override    

    public void init(FilterConfig config) throws ServletException {    

        //web.xml中的filter的配制信息中取得字符集    

        this.charset = config.getInitParameter("charset");    

    }    

limit:可选项,用于指定返回数组的最大长度。如果设置了该参数,返回的子串不会多于这个参数指定的数字,否则整个字符串都会被分割,而不考虑其长度。

返回值:一个字符串数组,该数组是通过delimiter指定的边界将字符串分割成的字符串数组。

注意:在使用split()方法分割数组时,返回的数组不包括delimiter自身。

例如,将字符串"2009-05-15""-"为分隔符分割成数组,代码如下:

var str="2009-05-15";  

var arr=str.split("-");     //分割字符串数组  

document.write("字符串""+str+""使用分隔符"-"进行分割后得到的数组为:<br>");  

//通过for循环输出各个数组元素  

for(i=0;i<arr.length;i++){  

    document.write("arr["+i+"]"+arr+"<br>");  

<script language="javascript">  

function realSysTime(clock){  

 flex android开发中关于请求报文代码的操作您都理解了熟悉了吗?其实在查看的时候建议您能够多看看flex开发中需要注意的一些事项的介绍信息。从而帮助自己更好的掌握关于flex开发需要理解以及注意的问题

0 0