struts에 대한 검색 결과

Apache Struts: 정말 간단한 로그인 구현(Struts 2.0.14)

간단한 로그인 구현. 먼저 UserVo.java 생성 CREATE TABLE user ( id varchar(25) NOT NULL, pw varchar(45) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 (데이터베이스에는 위와 같이 생성한다. 미리 id, pw를 적절히 넣어 두자.) UserDao.java 를 만들어서, 추후에 myBatis(iBatis)에서 매핑된 쿼리의 결과를 객체로 저장(리스트가 아니기 대문에 queryForObject()를 사용하면 된다.) User.xml을 만들어서 DB 쿼리 결과를 저장. SqlMapConfig.xml에서 새로 추가한 User.xml …

더 읽기 »

Apache Struts: Action Class(Struts 2.0.14)

도서: http://www.yes24.com/24/goods/3533040 액션 클래스 액션 클래스는 스트럿츠 2가 액션을 실행하기 위한 엔트리 포인트이다. 기본 액션 메소드는 묵시적으로 execute()로 지정되 있다. execute() 메서드의 리턴 값인 문자열(String)은 액션 실행이 끝난 후 어떤 리절트를 실행할지를 결정하기 위해 사용된다. 액션 메소드가 반환하는 이 문자열 값을 ‘리절트 코드’라 부른다. 위 에에서는 execute() 메소드가 message 변수에 “Hello World!”란 메시지를 설정하고 난 후 “success”를 반환 값으로 되돌린다. …

더 읽기 »

Apache Struts: 스트럿츠2 개요

스트럿츠가 무엇인지부터 살펴보자. 어제 프로젝트 실행을 위해 분리한 파일. 책에 따르면 아래와 같다. commons-logging-1.0.4.jar log4j와 같은 로깅용 freemarker-2.3.8.jar UI 태그 템플릿용 ognl-2.6.11.jar Object Graph Navigation Language라고 한다. struts2를 위한 EL임. JSP 2.1 스펙에 포함된 EL과 매우 비슷 struts2-core-2.0.14.jar 스트럿츠2의 코어 라이브러리 xwork-2.0.7.jar 스트럿츠 2에서 가장 새롭게 변한 것이 Webwork(=Xwork)와 통합된 것이다. xwork가 주가 되고 struts가 뒷받침해주는 형식으로 작동한다. 스트럿츠2에서는 사용자 …

더 읽기 »

Apache Struts: Hello World!(Struts 2.0.14)

https://archive.apache.org/dist/struts/binaries/ 에서 struts-2.0.14-all.zip 파일을 내려받는다.(엄청 오래 걸림 -_-;;) commons-logging-1.0.4.jar freemarker-2.3.8.jar ognl-2.6.11.jar struts2-core-2.0.14.jar xwork-2.0.7.jar 파일을 미리 다른 곳에 빼놓는다. Dynamic Web Project 만들기 이름을 적고, 다음 web.xml 만들기 /WebContent/WEB-INF/lib 폴더에 위에서 선택한 파일을 붙여 넣는다. web.xml에 필터를 등록함. <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>HelloWorld</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> …

더 읽기 »