일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Log4j
- 메모
- iBATIS
- Modeling
- Oracle
- java se
- 안드로이드
- 오라클
- 오류
- 관심책
- Android
- eclipse plugin
- TDD
- annotation
- 우분투
- ERD
- junit
- TAG 오류
- 초대장
- derby
- java
- 실수
- eclipse
- action
- Spring Framework
- 디자인 오류
- struts2
- Spring
- DATABASE
- 초대장 배포
- Today
- 12
- Total
- 579,107
목록Programming/Spring Framework (10)
거꾸로 토마토
SpringMVC에서 MultipartFile을 이용한 파일업로드 방법입니다. 1. 일단 jsp에서 태그 설정입니다. ... ... ... enctype="multipart/form-data"으로 작성해야 multipart 객체로 받을 수 있습니다. 2. Context 환경 설정 내용입니다. ... 102400000 ... spring에서 사용할 수 있는 기본 MultipartResolver를 선언합니다. 3. Controller 부분 내용입니다. import org.springframework.web.multipart.commons.CommonsMultipartFile ... @RequestMapping(value="/business/nondisRegisterPro.do") public String n..
Action 객체 내에서 request 및 response 객체를 얻어오는 방법이다. public class UserAction extends ActionSupport { ... public String execute() { HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); ... return SUCCESS; } } 일단 Action 객체는 ActionSupport 클래스를 상속한다. 그리고 객체 내에서 ServletActionContext 객체를 통해서 request와 response 객체를 얻어올 수 있다.
struts.xml에서 action을 등록하게 되는데 다음과 같다. /userRegi.jsp userListAction.do 태그가 다른형태의 두가지를 사용하고 있다. 첫번째 형태 /userRegi.jsp 는 바로 결과 페이지를 명시하는 것. executeGoto() 메소드를 수행 후 바로 userRegi.jsp로 이동하는 내용이다. 다음으로 userListAction.do 형태는 일단 속성 name과 type를 사용하고 있다. name은 action 함수에서 리턴하는 string을 명시하면된다. 리턴되는 string에따라 분기되는 방향을 명시하는 것이다. 다음으로 type 속성이 있는데 명시하는 이동 경로 이동하는 형태를 나타낸다. "chain"은 다른 액션으로 데이타와 같이 보낸다. 이 때 액션 이름..
spring 에서 log4j를 사용하기 위해서는 우선 log4j 라이브러리 jar을 포함시킵니다. 또한 web.xml에 listener를 등록합니다. log4jConfigLocation /WEB-INF/log4j.properties org.springframework.web.util.Log4jConfigListener 위 내용은 web.xml에 추가한 내용입니다. 내용에서 보면 WEB-INF 폴더에 log4j.properties 파일을 위치 시켜야 한다는 것도 파악 됩니다. log4j.properties 내용은 다음과 같이 작성합니다. log4j.rootLogger=INFO, stdout, logfile log4j.appender.stdout=org.apache.log4j.ConsoleAppender l..
Spring + Struts2 를 통합해서 사용할 때 다른 bean들은 singleton으로 default 값을 정의해도 되나 action은 singleton으로 정의 하면 문제가 발생할 수 있다. 동시 사용자들이 사용할 경우 action 객체를 공유하게 되면 수행 결과가 엉뚱하게 나타날 수도 있는 문제가 발생한다. 위에서 scope 속성을 정의 했는데 default 값은 'singleton'이다. 이것을 prototype으로 정의하면 action수행 할 때마다 action 객체가 생성된다.
● struts.properties 설정 파일 struts.i18n.reload= true struts.devMode = false #configuration에서 설정된 모든 xml 다시 로딩해해서 무조건 처리해라. 실무에서는 사용 금지!! struts.configuration.xml.reload = true struts.continuations.package = org.apache.struts2.showcase strtus.custom.i18n.resources = globalMessages #was의 포트 번호, default는 80 struts.url.http.port = 9000 struts.action.extension=do #struts.freemarker.manager.classname = ..
SpringJUnit4ClassRunner을 기반으로 iBatis DAO객체를 테스트 중입니다. insert 테스트중에 알 수 없는 현상이 발생했습니다. insert 수행에서 오류는 발생하지 않았는데 DB에는 INSERT 되지 않더군요. iBatis의 auto commit 설정을 살펴보니 sqlMap설정에서 transactionManager를 설정하지 않고 외부 dataSource를 사용하게 되면 auto_commit는 자동으로 되지 않는다고. 현재 저는 Spring 에서 설정되어 있습니다. PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQ..
spring 설정중에 오류를 겨우겨우 막아가면서 샘플 소스로 공부 중에 다음과 같은 오류가 발생했습니다. ... Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces. ...이해를 못하는 오류! 그래서 찾아보니 다음과 같은 내용을 찾았습니다. 직접 Class에 대한 Proxy를 이용하기 위해서 Spring Framework의 “lib/cglib” 위치에 있는 “cglib-nodep-2.1_3.jar” 라이브러리를 Class Path에 추가해 주면 된다.spring은 기본적으로 interface를 앞단에 정의하고 작성하는데 직접 class를 구현하려고 할 ..
1. @ContextConfiguration에 설정 xml 파일을 명시하지 않으면 -context.xml을 디폴트로 하여 찾는다. 없으면 exception을 발생한다. 2. @ContextConfiguration에서 path를 명시 할 때 class path에 존재하면 "classpath:/com/test/Beans.xml" 식으로 "classpath:"로 시작하고 그 외의 path이면 "file:web/WEB-INF/config/Beans.xml" 이런 식으로 "file:"으로 시작한다. 설정하고자 하는 file이 여러 개이면 콤마(,)로 구분하여 나열한다. 3.@TransactionConfiguration 에서 context fingfile에서 설정한 transactionManager bean 명을 ..