随笔-159  评论-114  文章-7  trackbacks-0



想起来就郁闷,这周重写了一个垃圾人的代码,也就是我这么高的高手能完成这样的艰巨的任务,在应用层代码和服务端代码都不是我自己的情况下,现分析再重写,再优化,再在周五保证无恙上线。谁也来不了!!

我实在是不能不说,以下文字带有不净词语,实属我无奈,因为星期三的那天我已经接近崩溃,我不得不说,请所有学Java的人注意。

开始展现:

   */
    public Vector getDimenionDocs(int vId, String attNo, String userId) {

        int t_myId = 0;
        Vector t_vec = new Vector();
        try {
            t_myId = Integer.parseInt(attNo);
        } catch (Exception ee) {
            t_myId = 0;
        }
 
     //着原来还有一个用Spring的东西呢。靠,你懂不懂Spring就用,明明一个Factory就能解决问题。
        
       
        DimensionDocObject[] dso = client.getDimensionDocs(vId, t_myId,StaticPara.MSG_WLB_FOLDER , userId);
      
        System.out.println("文档数量:" + dso.length);
       
        if (dso == null) {

            return t_vec;
        }
        for (int k1 = 0; k1 < dso.length; k1++) {
          
            t_vec.add(dso[k1]);
        }

        return t_vec;
    }

不知道你是否看到过 所有变量无实际意义,什么myId,我他妈的知道什么叫MyId!!!!!

还有静态常量大写拼音法开始了,
JSP混杂超复杂代码片断,
html与java混排,简直就他妈就不配用Java编程。
Struts Action的复用通过参数区分,明明就是需要两个Action就能解决问题,为了自认为是复用的形式,将两个逻辑合二为一,用一个objectId表示两个Jsp发过来的请求。通过Integer.parseInt()接受异常来判断两种情况的不同,以便取得不同值。简直。。。

complex.jsp
<% @ taglib uri = " /tags/struts-html "  prefix = " html "   %>
<% @ taglib uri = " /tags/struts-bean "  prefix = " bean "   %>
<% @ page  import = " com.bmcc.pageflow.util.* " %>
<% @ page  import = " com.bmcc.pageflow.web.* " %>
<% @ page  import = " java.util.* " %>
<% @ page  import = " com.ibm.b2e.webservice.documentum.DimensionServiceClient " %>
<% @ page  import = " com.ibm.b2e.webservice.documentum.data.DimensionDocObject " %>
<% @ page  import = " com.ibm.b2e.webservice.documentum.data.DimensionObject " %>
<% @ page  import = " com.ibm.b2e.webservice.documentum.util.DocumentumServiceClientFactory " %>
<% @ page  language = " java "   contentType = " text/html; charset=GBK " %>
<%
   String userId 
= (String)session.getAttribute( " userId " );
   String password 
= (String)session.getAttribute( " password " );
    
     Hashtable myTitle 
=   new  Hashtable();
    myTitle.put(
new  String( " wdly " ), new  String( " 文档来源 " ));
    myTitle.put(
new  String( " zdxm " ), new  String( " 重点项目 " ));
    myTitle.put(
new  String( " glsx " ), new  String( " 管理属性 " ));
    myTitle.put(
new  String( " zyfl " ), new  String( " 专业分类 " ));
    myTitle.put(
new  String( " gzgl " ), new  String( " 故障管理 " ));
    myTitle.put(
new  String( " bmwd " ), new  String( " 部门惟度 " ));
    myTitle.put(
new  String( " wlzl " ), new  String( " 网络质量 " ));  
    myTitle.put(
new  String( " xxaq " ), new  String( " 信息安全 " ));  
       myTitle.put(
new  String( " no " ), new  String( "" ));  
 
                                  
                                  
      String  myType 
=  (String)session.getAttribute( " myStatus " );      
      
if (myType  ==   null   ||  myType.length() == 0 ) {
         myType 
=   " bmwd " ;
      }
     
      
      String actionHref 
= "" ;      
      
      
if (myType.equals( " bmwd " )) {
             actionHref 
= " complex_detail "
      
      }
else {
          actionHref 
= " showDoc " ;
      }

%>
< html >
< head >
 
< title > Company web site  02 </ title >
 
< script language = " JavaScript " >
 
   function openView(abc)
{
   
// alert("<%=myType%>");
    if (abc  ==   " aqtx " ) {
        document.doc_multi.action
= " http://<%=StaticPara.MYHOST%>:9080/BmccPageFlow/sysMap.jsp " ;
   }
else   if (abc  ==   " gzgl " ) {
        document.doc_multi.action
= " http://<%=StaticPara.MYHOST%>:9080/BmccPageFlow/gzglMap.jsp " ;
   }
else {
          document.doc_multi.action
= " http://<%=StaticPara.MYHOST%>:9080/BmccPageFlow/wlzlMap.jsp " ;
   }

    
   document.doc_multi.submit();
}
   


function openDimension(myId)

     
// alert(myId);
     
// alert("<%=myType%>");
    document.doc_multi.action = " http://<%=StaticPara.MYHOST%>:9080/BmccPageFlow/simple.do " ;
    document.doc_multi.dimensionId.value
= myId;
     
    document.doc_multi.submit();
}

 
</ script >

 

 
</ head >
 
< body  leftmargin = " 0 "  topmargin = " 0 "   marginheight = " 0 "  marginwidth = " 0 " >

< form name = " doc_multi "  method = " post "   target = " _self " >
< input type = " hidden "  name = " userId "  value = " <%=userId%> " >
< input type = " hidden "  name = " dimensionId "  value = "" >
< input type = " hidden "  name = " password "  value = " <%=password%> " >
</ form >
 
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  width = " 980 " >
  
< tbody >< tr >
    
< td >< img src = " image/top3_06.gif "  alt = ""  height = " 60 "  width = " 163 " ></ td >
    
< td >< img src = " image/top3_07.gif "  alt = ""  height = " 60 "  width = " 82 " ></ td >
    
< td >< img src = " image/top3_08.gif "  alt = ""  height = " 60 "  width = " 82 " ></ td >
    
< td >< img src = " image/top3_09.gif "  alt = ""  height = " 60 "  width = " 82 " ></ td >
    
< td >< img src = " image/top3_10.gif "  alt = ""  height = " 60 "  width = " 81 " ></ td >
    
< td >< img src = " image/top3_11.gif "  alt = ""  height = " 60 "  width = " 358 " ></ td >
    
< td >< img src = " image/top3_12.gif "  alt = ""  height = " 60 "  width = " 143 " ></ td >
  
</ tr >
  
< tr >
    
< td colspan = " 7 " >
    
< img src = " image/top3_13.gif "  alt = ""  height = " 15 "  width = " 980 " ></ td >
  
</ tr >  
</ tbody ></ table >
< table height = " 4 " >
  
< tbody >< tr >  
    
< td align = " right "  width = " 980 " >
                    
                    
< p align = " left " >
                    
< font size = " 2 " >
& nbsp;网络知识文档管理  & gt;   <%= (String)myTitle.get(myType) %> 管理 </ font ></ td >
  
</ tr >  
</ tbody ></ table >
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 10 "  width = " 980 " >
  
< tbody >< tr >
    
< td colspan = " 2 "  height = " 100% "  valign = " top " >            
        
< a name = " wpsMainContent " ></ a >
 
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  height = " 100% "  width = " 100% " >
    
< tbody >< tr >
        
< td valign = " top " >
   
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  height = " 100% "  width = " 100% " >
    
< tbody >< tr width = " 100% " >

         
 
        
< td valign = " top "  width = " 100% " >
            
 
< table align = " center "  border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  width = " 100% " >
    
< tbody >< tr height = " 100% " >
         
< td valign = " top "  width = " 214 " >
            
 
      
< table width = " 968 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 0 "  id = " table1 " >
        
< tr >  
          
< td width = " 13 "  rowspan = " 14 " >< img src = " image/spacer.gif "  width = " 13 "  height = " 1 " ></ td >
           
< td valign = " top "  rowspan = " 14 " >  
            
< table width = " 199 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 0 "  id = " table2 " >
              
< tr >  
                
< td colspan = " 3 " >< img src = " image/obj_products.gif "  width = " 199 "  height = " 46 " ></ td >
              
</ tr >
              
< tr >  
                
< td background = " image/obj_waku_left.gif "  width = " 11 " >< img src = " image/spacer.gif "  width = " 9 "  height = " 1 " ></ td >
                
< td width = " 180 "  background = " image/bg_waku.gif "  valign = " top " >  
                  
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 0 "  id = " table3 " >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table4 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " bmwd " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >
                            
< a href = " # "  Onclick = " openDimension('<%=StaticPara.BUMENWEIDU%>');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 " > 部门维度 </ font ></ a >& nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table5 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " glsx " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >  
                            
< a href = " # "  Onclick = " openDimension('<%=StaticPara.GUANLISHUXING%>');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 " > 管理维度 </ font ></ a >& nbsp; & nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table6 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " wdly " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >  
                            
< a href = " # "  Onclick = " openDimension('<%=StaticPara.WENDANGLAIYUAN%>');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 " > 文档来源维度 </ font ></ a >& nbsp; & nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table7 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " zdxm " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >  
                            
< a href = " # "  Onclick = " openDimension('<%=StaticPara.ZHONGDIANXIANGMU%>');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 " > 重点项目维度 </ font ></ a >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table8 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " zyfl " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >  
                            
< a href = " # "  Onclick = " openDimension('<%=StaticPara.ZHUANYEFENLEI%>');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 " > 专业分类维度 </ font ></ a >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td >< img src = " image/<%if(myType.equals( " etom " )){out.println( " shu2.gif " );}else{out.println( " shu1.gif " );}%> "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >< font size = " 2 "  face = " 宋体 " >  
                            
<!--< a href = " # "  Onclick = " openDimension('<%=StaticPara.ETOM%>');return false; "  target = " _self "    class = " newslink1 " >-->< font size = " 2 " > eTOM 维度 </ font ></ a >& nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
                    
        
< tr >  
                      
< td >  
                        
< table width = " 166 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td >< img src = " image/shu1.gif "  width = " 16 "  height = " 16 " ></ td >
                            
< td align = " left " >  
                            
< a href = " # "  Onclick = " openView('aqtx');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 "  face = " 宋体 " > 信息安全体系视图 </ font ></ a >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
             
                    
                    
              
< tr >  
                      
< td >  
                        
< table width = " 163 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td >< img src = " image/shu1.gif "  width = " 16 "  height = " 16 " ></ td >
                            
< td >< a href = " # "  Onclick = " openView('gzgl');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 "  face = " 宋体 " > 故障管理  </ font ></ a >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
               
    
< tr >  
                      
< td >  
                        
< table width = " 162 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td >< img src = " image/shu1.gif "  width = " 16 "  height = " 16 " ></ td >
                            
< td >< a href = " # "  Onclick = " openView('wlzl');return false; "  target = " _self "    class = " newslink1 " >< font size = " 2 "  face = " 宋体 " > 网络质量管理  </ font ></ a >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                  
                    
  
< tr >  
                      
< td >  
                        
< table width = " 162 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
  
< tr >  
                      
< td >  
                        
< table width = " 161 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
 
< tr >  
                      
< td >  
                        
< table width = " 160 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
     
< tr >  
                      
< td >  
                        
< table width = " 159 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
 
< tr >  
                      
< td >  
                        
< table width = " 157 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
               
    
< tr >  
                      
< td >  
                        
< table width = " 157 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
 
< tr >  
                      
< td >  
                        
< table width = " 157 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
 
< tr >  
                      
< td >  
                        
< table width = " 158 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table9 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >< font size = " 2 "  face = " 宋体 " >& nbsp; & nbsp; & nbsp;  </ font ></ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                 
                    
                    
< tr >  
                      
< td >  
                        
< table width = " 155 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 3 "  id = " table10 " >
                          
< tr >  
                            
< td ></ td >
                            
< td >   </ td >
                          
</ tr >
                        
</ table >
                      
</ td >
                    
</ tr >
                    
< tr >  
                      
< td >< img src = " image/line_01.gif "  width = " 166 "  height = " 9 " ></ td >
                    
</ tr >
                    
</ table >
                
                
</ td >
                
< td background = " image/obj_waku_right.gif "  width = " 9 " >< img src = " image/spacer.gif "  width = " 9 "  height = " 1 " ></ td >
              
</ tr >
              
< tr >  
                
< td colspan = " 3 " >< img src = " image/obj_waku_bottom.gif "  width = " 199 "  height = " 11 " ></ td >
              
</ tr >
            
</ table >
           
          
</ td >
          
< td width = " 786 "  rowspan = " 14 "  valign = " top " >
      
< table width = " 754 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 0 "  id = " table18 " >
        
< tr >  
          
< td valign = " top "  align = " center "   width = " 52 " >
  
< table border = " 0 "  cellpadding = " 4 "  cellspacing = " 1 "  height = " 100% "  width = " 95% "  id = " table26 " >
    
< tbody >< tr >
        
< td >
             
</ td >
        
< td >
             
</ td >
        
< td >
            
< table  class = " wpsPortletBody "  border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  height = " 100% "  width = " 100% "  id = " table27 " >
                
< tbody >< tr >
                    
< td >
                        
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 0 "  width = " 100% "  id = " table28 " >
                            
< tbody >< tr >
                                
< td align = " left "  bgcolor = " #3590d1 "  height = " 20 "  nowrap = " nowrap "  valign = " middle "  width = " 100% " >
                                                                        
< table id = " table29 " >< tbody >< tr >< td  class = " ds " >
                                                                            
< b >
                                                                            
< font size = " 2 "  color = " #FFFFFF " >
                                                                             
<%= (String)myTitle.get(myType) %></ font ></ b >& nbsp;
                                                                    
</ td ></ tr ></ tbody ></ table ></ td >
                                
< td align = " right "  bgcolor = " #3590d1 "  nowrap = " nowrap "  valign = " middle " >
                                    
                                     
                                    
                                    
                                    
& nbsp;
                                
</ td >
                            
</ tr >
                        
</ tbody ></ table >
                    
</ td >
                
</ tr >
                
                    
< tr >
                        
< td dir = " ltr "  style = " border-left: 1px dashed rgb(128, 171, 198); border-right: 1px dashed rgb(128, 171, 198); border-bottom: 1px dashed rgb(128, 171, 198); "  bgcolor = " #ffffff "  height = " 100% "  valign = " top "  width = " 100% " >
                            
< table border = " 0 "  cellpadding = " 0 "  cellspacing = " 10 "  width = " 100% "  id = " table30 " >< tbody >< tr >< td >  


 
< form method = " post "  name = " fastFindForm "  action = " http://portal501.bmcc.com.cn:9080/bluepage/fastFind.do "  target = " _blank " >
  
< table border = " 0 "  cellpadding = " 2 "  cellspacing = " 1 "  width = " 100% "  id = " table31 " >
  
< tbody >< tr >
    
< td style = " padding: 10px; "  align = " top " >  
      
< table width = " 707 "  border = " 0 "  cellspacing = " 0 "  cellpadding = " 0 "  id = " table40 "  vlign = " top " >
      
< tr >< td >< table border = 0  align = center cellspacing = " 0 "  cellpadding = " 0 " >
  
<%
  
    

    Node myNode 
=  (Node) session.getAttribute( " showAllNode " );
       String all_leaf 
= "" ;
       String fontCol[] 
=   new  String[]  { " #34D823 " , " #2277D7 " , " #FA8900 " , " #7622D5 " , " #D72244 " , " #D52298 " } ;
       String imgId[]   
=   new  String[] {myType + " 1.gif " ,myType + " 2.gif " ,myType + " 3.gif " ,myType + " 4.gif " ,myType + " 5.gif " ,myType + " 6.gif " } ;
        
int   colId   =   0
        String myCol 
= "" ;
        String myImg 
= "" ;
       
for (Iterator iter1  =  myNode.getChildren().iterator();iter1.hasNext();)  {
            
boolean  has_next =   true ;
            
if (colId  <   6 ) {
               myCol 
=  fontCol[colId];
               myImg 
=  imgId[colId];
            }
else {
               myCol 
= " #34D823 " ;
               myImg 
= myType + " 1.gif " ;
            }

          Node node1 
=  (Node)iter1.next();
             Iterator iter22 
=  node1.getChildren().iterator();
             
if (iter22.hasNext())
               out.println(
" <tr> " );
            
//   out.println("<td width=100 colspan=2><img src='image/ba2_whatsnew.gif' width='507' height='21' border='0' usemap='#Map2'>");
              out.println( " <td   valign='top'  align='left'  width='650' height='21' colspan=2 background='image/ba2a.gif' >&nbsp;&nbsp;<font color='' size=2 face='宋体'> " + node1.getAttName() + " </font> " + " </td> " );
                  
             
             }
else {
               
//  如果是部门纬度,那么增加参数from
                   if (myType.equals( " bmwd " )) {
                          all_leaf 
=  all_leaf  + " <td valign='bottom' background='image/1-1.gif' width='92' height='26' align='center'> " + " <a href=' " + actionHref + " .do?objectId= " + node1.getObjectId() + " &objectName= " + node1.getAttName() + " &nextAction=begin'><font size='2'> " + node1.getAttName() + " </font></a> " + " </td> " ;
                  }
else {
                           all_leaf 
=  all_leaf  + " <td valign='bottom' background='image/1-1.gif' width='92' height='26' align='center'> " + " <a href=' " + actionHref + " .do?objectId= " + node1.getAttId() + " &objectName= " + node1.getAttName() + " &nextAction=begin&from=sysMap'><font size='2'> " + node1.getAttName() + " </font></a> " + " </td> " ;
                  }
  
                 
                 has_next 
=   false ;
                  
             }

         colId
++ ;
          
          
          out.println(
" <tr> " );
           out.println(
" <td> " );
           
if (has_next) {
            out.println(
" <img src='image/ " + myImg + " ' width='51' height='57'> " ); 
           }
else {
              
// out.println("&nbsp;");
           }

          
// "+myCol+"
           out.println( " </td> " );
          
          out.println(
" <td><table border=0><tr> " );
          
int  i  = 0 ;
          
for (Iterator iter2  =  node1.getChildren().iterator(); iter2.hasNext();) {               
                Node node2 
=  (Node)iter2.next();    
                
if (i  !=   6 ) {
                  
if (myType.equals( " bmwd " )) {
                      out.println(
" <td width=100><font color='#FFFFFF' size='2'  face='宋体'><a href=' " + actionHref + " .do?objectId= " + node2.getObjectId() + " &objectName= " + node2.getAttName() + " &nextAction=begin'> " + node2.getAttName() + " </a></font></td> " );
                  }
else {
                    out.println(
" <td width=100><font color='#FFFFFF' size='2'  face='宋体'><a href=' " + actionHref + " .do?objectId= " + node2.getAttId() + " &objectName= " + node2.getAttName() + " &nextAction=begin&from=sysMap'> " + node2.getAttName() + " </a></font></td> " );
                  }

                  
                  i 
++ ;
                }

                
if (i  == 6 ) {
                  out.println(
" </tr> " );
                   i 
= 0 ;       
                }

                
if (i  ==   0 ) {
                    out.println(
" <tr> " ); 
                 }
         
          }
 
           
int  j  =   6 - i;
           
if (j  !=   6 ) {
             
for ( int  k = 0 ;k < j;k ++ ) {out.println( " <td>&nbsp;</td> " );}
           }

           
          out.println(
" </td></tr></table></td> " );
          out.println(
" </tr> " );
    }

   
   
//  print(myNode);
 
    
 
%>
 
< tr >< td colspan  = 2  align =  center >< table >< tr ><%= all_leaf %></ tr ></ table >< td ></ tr >
 
</ table ></ td ></ tr ></ table >
    
</ td >
  
</ tr >
  
< tr >
    
< td bgcolor = " #578bbd "  height = " 1 " >   </ td >
  
</ tr >

</ tbody ></ table >

</ form ></ td ></ tr ></ tbody ></ table >
                        
</ td >
                    
</ tr >
                

            
</ tbody ></ table >
        
</ td >
    
</ tr >
</ tbody ></ table >
            
</ td >
        
</ tr >
        
</ table >
            
< p align = " center " >

< img src = " image/spacer.gif "  width = " 11 "  height = " 1 " ></ td >
         
          
< td width = " 13 "  rowspan = " 14 " >< img src = " image/spacer.gif "  width = " 13 "  height = " 1 " ></ td >
        
</ tr >
        
</ table >
       
</ td >
    

    
</ tr >
</ tbody ></ table >



        
</ td >
    
</ tr >
</ tbody ></ table >


        
</ td >
    
</ tr >
    
    
</ tbody ></ table >
 
    
</ td >
  
</ tr >
</ tbody ></ table >     

    





    
   
</ body >
</ html >



像这种垃圾代码,能维护么?学过Jsp么?用一个标签不好么?TMD sHIT.



写代码不是发泄情绪,那是创造价值。



posted on 2006-08-13 09:24 北国狼人的BloG 阅读(1162) 评论(8)  编辑  收藏 所属分类: 人生各层面经验积累

评论:
# re: 不要写垃圾代码!!! 2006-08-13 12:46 | 路过的发表下意见
看得出你不是一个优秀的程序员。
  回复  更多评论
  
# re: 不要写垃圾代码!!! 2006-08-13 15:53 | 本文作者
呵呵,只有一种可能你说出这样的评价,那就是你也写这么垃圾的代码。

那就没有办法了,发个屁就走了,连名字都不敢留,怕我打你。哈哈。


还有一种可能,程序员不是奴隶,我不想做代码的奴隶,我早晚有一天不做程序员。看来你把自己永远定位成一个coder,那永远都是Coder。  回复  更多评论
  
# re: 不要写垃圾代码!!! 2006-08-13 16:33 | kangxm
你同事的代码不敢恭维!不过,我也确实没看出你是个什么样的高手!除了jsp之外,我还真没觉得同事的代码可以让你气愤成这样!还能让你崩溃到什么程度?

有本事把你改过的代码贴上来让大家都看看!我倒要看看所谓的高手是怎么样写代码的?  回复  更多评论
  
# re: 不要写垃圾代码!!! 2006-08-25 04:31 | ll
呵呵,在中国自认高手的自夸是大忌,谦虚是2000多年的美德啊,唉,没办法
不过说真的,程序员永远不能定义自己是高手,技术方面博大精深,学的东西太多了,一个人用几辈子时间也无法占领某个领域  回复  更多评论
  
# re: 不要写垃圾代码!!! 2006-09-04 15:14 | 层次比较低
垃圾  回复  更多评论
  
# re: 不要写垃圾代码!!! 2008-08-29 13:54 | 路过
楼主估计压抑太久,在YY中。  回复  更多评论
  
# re: 不要写垃圾代码!!! 2008-09-03 15:19 | 你更垃圾
达内出来也有你这样的意淫分子啊
还05年培训的 就这水平.  回复  更多评论
  
# re: 不要写垃圾代码!!![未登录] 2012-03-26 13:01 | rex
楼主刚出生就断奶了,确实牛  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: