달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

게시판을 플래쉬로 가잰다...

 

그래서.... 알아본 결과.... &val_1=xxx&val_2=yyy 와 같은 방식과..

 

XML 로 데이터를 날려서.. 플래쉬에서 xml 을 파싱하는 방법이 있더만...

 

결국 xml 로 하기로 했음.... xml 로 만드는 툴은 jdom 을 선택

 

그래서리... 급조하여 아래의 코드가 나옴 ㅡㅡ

 

덕분에 Action 클래스가 300 줄에 육박 ㅡㅡ 미챠~~~

 

플래쉬에서 파일 업로드는 어케 허나... 환장하겠네 ㅡㅡ

 

//------------------------------------------------------------
  //  게시판 리스트 XML 생성
  //------------------------------------------------------------
  
  Element rootEL = new Element("board-list");
  
  Document doc = new Document(rootEL);
  
  Element articles = new Element("articles");
  
  rootEL.addContent(articles);

  Element articleElement = null;
  
  int virtualNum = p.getVirtualNumber();
  
  while(iter.hasNext()){


   dyna = (DynaBean)iter.next();

 

   articleElement = new Element("article");
   
   Element[] ele = new Element[fieldNames.length];
   
   for(int i = 0; i <fieldNames.length; i++){
    
    ele[i]= new Element(fieldNames[i]);
    
    // 가상 번호 적어주기.
    if("virtualNum".equals(fieldNames[i])){
     
     ele[i].setText("" + virtualNum);
     
    }else if("regidate".equals(fieldNames[i])){
     
     ele[i].addContent(BoardUtil.modifyDate(dyna.get(fieldNames[i]).toString(), true));
     
    }else{
     
     ele[i].addContent(dyna.get(fieldNames[i]).toString());
     
    }

    articleElement.addContent(ele[i]);    
       
   }

 

 

Posted by tornado
|