2014년 3월 31일 월요일

(Spring3.2 Board) Spring 3.2에서 게시판 작성하기[5. BoardDTO 만들기 ] ,[자바교육/자바강좌/SpringFramework/스프링교육/자바교육잘하는곳/자바교육추천/자바실무교육/JAVA/JAVA교육/JAVA학원/JAVA실무교육]

(Spring3.2 Board) Spring 3.2에서 게시판 작성하기[5. BoardDTO 만들기 ] ,[자바교육/자바강좌/SpringFramework/스프링교육/자바교육잘하는곳/자바교육추천/자바실무교육/JAVA/JAVA교육/JAVA학원/JAVA실무교육]

 게시판 리스트 제작을 먼저 하기로 하고 BoardDTO 부터 만들어 보자.:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
BoardDTO는 게시판 테이블과 구조가 같은 도메인객체로서 게시판 리스트 보기 같은 곳에서 전체 게시물을 읽어 하나씩 BoardDTO에 담아서 LIST 객체를 이용하여 JSP로 전송해 준다. DTO라는 이름처럼 웹 애플리케이션에서 서로 다른 Layer 에서 데이터를 전송하기 위한 객체로서의 역할을 하는 클래스이다.
[BoardDTO.java]
package onj.board.model;
public class BoardDTO {
       private int seq;
       private String name;
       private String passwd;
       private String title;
       private String content;
       private String fileName;
       private String regdate;
       private int readCount;
       private int reply;
       private int reply_step;
       private int reply_level;
      
       public BoardDTO() {}
      
       public BoardDTO(String name, String passwd, String title, String content, String fileName) {
             this.name = name;
             this.passwd = passwd;
             this.title = title;
             this.content = content;
             this.fileName = fileName;
       }
      
       public BoardDTO(String name, String passwd, String title, String content, String fileName, int readCount) {
             this.name = name;
             this.passwd = passwd;
             this.title = title;
             this.content = content;
             this.fileName = fileName;
             this.readCount = readCount;
       }
       public int getSeq() {
             return seq;
       }
       public void setSeq(int seq) {
             this.seq = seq;
       }
       public String getName() {
             return name;
       }
       public void setName(String name) {
             this.name = name;
       }
       public String getPasswd() {
             return passwd;
       }
       public void setPasswd(String passwd) {
             this.passwd = passwd;
       }
       public String getTitle() {
             return title;
       }
       public void setTitle(String title) {
             this.title = title;
       }
       public String getContent() {
             return content;
       }
       public void setContent(String content) {
             this.content = content;
       }
       public String getFileName() {
             return fileName;
       }
       public void setFileName(String fileName) {
             this.fileName = fileName;
       }
       public String getRegdate() {
             return regdate.substring(0, 10);  //2013-07-15 형태
       }
       public void setDate(String regdate) {
             this.regdate = regdate;
       }
       public int getReadCount() {
             return readCount;
       }
       public void setReadCount(int readCount) {
             this.readCount = readCount;
       }
       public int getReply() {
             return reply;
       }
       public void setReply(int reply) {
             this.reply = reply;
       }
       public int getReply_step() {
             return reply_step;
       }
       public void setReply_step(int reply_step) {
             this.reply_step = reply_step;
       }
       public int getReply_level() {
             return reply_level;
       }
       public void setReply_level(int reply_level) {
             this.reply_level = reply_level;
       }     
      

댓글 없음:

댓글 쓰기