jsp 压缩代码 java

要用到serlvet过滤器 这里只是简单介绍方法

 

StringBuilder sb = new StringBuilder();
          char[] c = result.toCharArray();
             int cont = c.length;
             try{
              long a =0;
                 long b =0;
                 for(int i=0;i<cont;i++){
            a=(long)c[i];
            if(a==9){ 
            }else if(a==13){
            }else if(a==10){ 
            }else if(a==32){
             b = (long)c[i+1];
             if(b==60){ 
             }else if(!(b==32)){
              sb.append(c[i]);
             }
                  }else{
             sb.append(c[i]);
            }
          }
             }catch (Exception e) {
              c =null;
              result = sb.toString();
              System.out.println(result+"ssss");
       }

你可能感兴趣的:(java,c,jsp,exception,null)