Struts 2 Convention 플러그 인의 사용
4256 단어 convention
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("/")
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
[JS] Maximum call stack size exceeded 해결 | class getter setter 이해하기자바스크립트에서 클래스를 만들 때 다음과 같이 만들었다고 해보자. name을 값으로 입력받는 class St 를 만들었다. 입력받은 name을 setter로 넘겨 값을 업데이트해주려고 한다. 이 때 call stac...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.