1. /WEB-INF/tags 폴더 : "태그 파일" 기반의 커스텀태그

2. /WEB-INF/tld 폴더 : "핸들러 클래스" 기반의 커스텀태그

 

/WEB-INF/tags/* → /app_config/tags/* 로 경로를 변경할 수 있을까? 

확인한 바로는 이동 불가하다.

 

참고 문서 : https://docs.oracle.com/javaee/1.4/tutorial/doc/JSPTags5.html

Tag File Location

Tag files can be placed in one of two locations: in the /WEB-INF/tags/ directory or subdirectory of a web application or in a JAR file (see Packaged Tag Files) in the /WEB-INF/lib/ directory of a web application. Packaged tag files require a tag library descriptor (see Tag Library Descriptors), an XML document that contains information about a library as a whole and about each tag contained in the library. Tag files that appear in any other location are not considered tag extensions and are ignored by the web container.

 

 

 

/WEB-INF/tld/* → /app_config/tld/* 로 경로를 변경할 수 있을까? 

가능하다.

 

web.xml 파일에서 아래와 같이 경로를 설정하면 된다.

<jsp-config>
	<taglib>
		<taglib-uri>
			http://abcdefg.co.kr
		</taglib-uri>
		<taglib-location>
			/app_config/tld/abcdefg.tld
		</taglib-location>    
	</taglib>
</jsp-config>

<welcome-file-list>
        <welcome-file>/</welcome-file>
</welcome-file-list>

 

WebContent - WEB-INF/tags

                 - app_config/tld

 

위와 같이 WebContent 하위에서 이동은 가능하지만 그 외 이동은 불가하다.

예를 들어 특정 외부 폴더 (C:/project/Appserver/tomcat/app_config/tld) 로 이동은 안된다.

'JSP' 카테고리의 다른 글

[JSP] cannot be resolved to a type 오류 해결  (0) 2020.10.26

이클립스에서 Import 할 때 위 사진와 같이 오류가 발생하는 경우가 있습니다.

(오류 메세지 : Multiple annotations found at this line: - String cannot be resolved to a type)

이러한 오류는 이클립스가 JDK를 인식하지 못하는 상황입니다.

아래와 같이 확인을 해야합니다.

 

1. 프로젝트 마우스 오른쪽 클릭 → Build Path → Configure Build Path... 클릭

 

 

위 사진과 같이 JRE Library에 빨간색으로 X 표시가 되어있는 것을 볼 수 있습니다.

JRE를 제거하고 다시 설정해보겠습니다.

2. JRE System Library 선택 → Remove 클릭

 

 

3. Add Library... 클릭 → JRE System Library 선택 → Next 클릭

 

 

4. Workspace default JRE 선택 → Finish 클릭

 

 

위 사진과 같이 오류 해결된 것을 확인할 수 있습니다!

'JSP' 카테고리의 다른 글

tags, tld 폴더의 경로는 이동할 수 있을까?  (0) 2021.12.21

+ Recent posts