Struts 2 Convention 플러그 인의 사용

4256 단어 convention
다음으로 이동:http://chenjumin.iteye.com/blog/668389
 
1. 상수 설명
      
 1       struts.convention.result.path="/WEB-INF/content/":           ,    "/" 2       struts.convention.action.suffix="Action": action      

 3       struts.convention.action.name.lowercase="true":    Action      

 4       struts.convention.action.name.separator="-" 5       struts.convention.action.disableScanning="false":       。

 6       struts.convention.default.parent.package="convention-default":       。

 7       struts.convention.package.locators="action,actions,struts,struts2":         。

 8       struts.convention.package.locators.disable="false" 9       struts.convention.package.locators.basePackage=""10       struts.convention.exclude.packages="org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*":         。

11       struts.convention.relative.result.types="dispatcher,velocity,freemarker":            。

12       struts.convention.result.flatLayout="true":                。        error, true  hello_world_error.jsp,false  hello_world/error.jsp。

13       struts.convention.classes.reload="false"14   

15       struts.convention.action.mapAllMatches="false"16       struts.convention.action.checkImplementsAction="true"17       struts.mapper.alwaysSelectFullNamespace="true"18       struts.convention.redirect.to.slash="true"19       struts.convention.action.alwaysMapExecute="true"20       struts.convention.action.fileProtocols="jar" :

 
 
2. 약속 을 묵인 한다
      Action 이름 의 맵: Action 접 두 사 를 제거 하고 단어 사이 에 선 을 그 으 며 단어의 이니셜 이 소문 자로 변 합 니 다.예 를 들 어 TestFormAction 류 에 대응 하 는 Action 이름 은 test - form 이다.
 
      Action 클래스 의 패키지 경 로 는 네 임 스페이스 경로 로, 네 임 스페이스 경 로 는 URL 경로 로 전 환 됩 니 다.예 를 들 어 com. cjm. action. card. sim. simCardInputAction 은 네 임 스페이스 가 / card / sim 이 고 Action 이름 은 sim - card - input 입 니 다.
      Action 류 의 패키지 경 로 를 결과 페이지 의 저장 디 렉 터 리 로 바 꾸 고 결과 페이지 의 약속 을 찾 습 니 다.            action 이름 찾기 - result 이름. jsp, 찾 을 수 없습니다.            action 이름 찾 습 니 다. jsp, 찾 을 수 없습니다.            action 명 찾기 - result 명. action
 
3. 주해
      1) @ ResultPath: 결과 페이지 가 어디 에 있 는 지 설정 하여 기본 값 을 덮어 씁 니 다.기본 값 은 struts. convention. result. path 상수 로 설정 합 니 다.            @ResultPath("/WEB-INF/pages")
 
      2) @ Namespace: action 의 URL 경 로 를 설정 하여 기본 값 을 덮어 씁 니 다.            @Namespace("/")

좋은 웹페이지 즐겨찾기