목록program (73)
yoursyun
목적 - 저수준의 데이터 액세스 로직과 고급 비즈니스 로직을 분리한다. 전형적인 DAO 구현 요소 - DAO 팩토리 클래스 - DAO 인터페이스 - DAO 인터페이스를 구현하는 구체적 클래스 - 데이터 전송 객체들(밸류(value) 객체) https://www.ibm.com/developerworks/kr/library/j-dao/
정확한 형태의 MVC 인지... 의문이 좀 들긴 하지만, 구글링을 참조 하여 MVC 형태의 게시판을 제작해 보았습니다. 제작된 파일은 첨부된 파일을 확인 하시면 됩니다. 데이터 베이스는 mySQL을 써보았습니다. [ 테이블 생성 구문 ] # create table CREATE TABLE tb_gWareBoard ( idx int(4) not null auto_increment primary key -- 인덱스 , seq int(4) not null -- 게시물 순번 , parentidx int(4) not null DEFAULT 0 -- 부모 인덱스 , title varchar(100) not null -- 게시물 제목 , userName char(20) not null -- 작성자명 , userEmai..
받아온 파라미터를 '|'를 통한 형태의 문자열 체크 표본을 만들고 검사 한다. public string chk_Injection(string strParam) { string pattern = "script|iframe|frameset|onmouse" + "|select|declare|delete|create|drop|union|exec|sp_oacreate" + "|xp_cmdshell|shutdown|kill|truncate|execmaster|netlocalgroupadministratthens" + "|--|@variable|@@variable|sysobject"; string rtnString = strParam; Regex rx = new Regex(pattern, RegexOptions.Co..
Const RNDUSERCNT = 150 '몇명을 뽑을 것 인가. dim cnt: cnt = 0 ' 뽑힌 인원 수 dim dataCnt: dataCnt = 0 dim setUserIdx: setUserIdx = 0 dim strSQL: strSQL = "적당한쿼리로기준열1개의레코드셋을리턴" set objQuery = new clsQuery arrList = objQuery.getRs(strSQL, null, null) set objQuery = nothing dataCnt = ubound(arrList, 2) set dicUser = CreateObject("Scripting.Dictionary") ' 대상자 set Winner = CreateObject("Scripting.Dictionary") ' 뽑..
* 한빛 헤드 퍼스트 교재 참조 * 작업을 들어가기전 해당 교재나 또는 개발, 배포 디렉토리 설정 같은게 필요 합니다. (구길에 가믄 더 좋은 형태? 로 볼 수 있네염.... ) [ web.xml ] * 실 적용시 주석은 삭제 MVC Beer com.example.web.BeerSelect MVC Beer /SelectBeer.do [ BeerSelect.java ] // 개발 환경, 배포 환경 디렉토리와 일치 해야 합니다. package com.example.web; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class BeerSelect extends HttpServlet { public void doPo..
이 페이지는 어떻게 자바스크립트에서 클래스의 private 변수와 메소드를 생성하는지 person이라는 간단한 예제를 통하여 보여줍니다. Part 2 는 상속을 다루겠습니다. 요약 private 변수는 객체 안에서 'var' 키워드로 선언된다, 그리고 private 함수와 privileged 메소드만이 접근 할수 있다. private 함수는 객체의 생성자 안에서 선언된다. (또는 다른 방법으로 varfunctionName=function(){...} 이와 같은 방법을 통해 선언이 가능하다) 그리고 privileged 메소드에 의해서만 호출이 가능하다. (객체의 생성자를 포함해서). privileged 메소드는 다음과 같이 선언한다. this.methodName=function(){...} 객체 바깥의 코..
명함클래스(NameCard)와 출력하는 클래스(PrintNameCard)가 있고, NameCard는 print() 메소드가 있어서 스스로 출력도 되어야 한다고 생각해봅시다. public class NameCard { String name; String phone; String email; PrintNameCard printNameCard; public void setPrintNameCard(PrintNameCard p) { this.printNameCard = p; } public void print() { printNameCard.print( this ); } } public class PrintNameCard { public void print( NameCard nc ) { System.out.pri..
import com.opensymphony.xwork2.Action; //domain object 를 위한 class import tutorial.User.UserDao; import tutorial.User.User; public class userInfo implements Action, Preparable, ModelDriven{ User user; // domain object @Override public String execute() throws Exception{ display = displayMyStr; UserDao userDao = new UserDao(); userDao.createUser(user); return SUCCESS; } // prepare method public voi..
// ActionSupport class 상속 import com.opensymphony.xwork2.ActionSupport; public class myTest extends ActionSupport{ private String display; private String displayMyStr; public myTest(){ display = "init"; displayMyStr = ""; } @Override public void validate(){ if(displayMyStr == null || "".equals(displayMyStr)){ addFieldError("myStr", "null value"); } } @Override public String execute() throws Exce..
// Action interface 상속 (일반 POJO 형태도 상관 없다) // import com.opensymphony.xwork2.Action; // public class myTest implements Action{ import com.opensymphony.xwork2.Action; public class myTest implements Action{ private String display; private String displayMyStr; public myTest(){ display = "init"; displayMyStr = ""; } public String getMessage(){ return display; } public void setMyStr(String myStr){ di..
package tutorial; import com.opensymphony.xwork2.Action; // Action 인터페이스를 구현해서 만든 부분 // import com.opensymphony.xwork2.Action; // implements Action // @Override public class HelloWorld implements Action { private String message; public String getMessage(){ return message; } @Override public String execute() throws Exception{ message = "Hello World !"; return SUCCESS; } } * 장점 : 코드의 정형화 (return S..
프로젝트 스케쥴러를 만들기위해 한줄짜리 달력을 class 로 만들어 보았다... using System; using System.Web.UI; using System.Web.UI.WebControls; /// /// Class_OneLineCalendar의 요약 설명입니다. /// public class Class_OneLineCalendar { public int Year = 0, Month = 0, _Today = 0; private string _PjStartDate = string.Empty, _PjEndDate = string.Empty, _PjFinishDate = string.Empty; public string PjStartDate { get { return _PjStartDate; } s..
/helloWorld.jsp