2010-07-28 6 views
1

모듈의 서버 폴더에 다음 코드가 있습니다.GWT의 서버 측에서 Regex 클래스가 작동하지 않습니다.

Pattern regex = Pattern.compile("/(B[A-Z0-9]{9})/"); 
Matcher matcher = regex.matcher(detailPageUrl); 

하지만 난 여전히 다음과 같은 오류를 얻을 :

[ERROR] Line 14: The import java.util.regex cannot be resolved 
[ERROR] Line 15: The import java.util.regex cannot be resolved 
[ERROR] Line 202: Pattern cannot be resolved to a type 
[ERROR] Line 202: Pattern cannot be resolved 
[ERROR] Line 203: Matcher cannot be resolved to a type 

나는 코드에서

import java.util.regex.Matcher; 
import java.util.regex.Pattern; 

을 가져온.

Regex가 서버 측에서 작동한다고 생각했습니다. 왜 이것이 작동하지 않습니까?

+0

폴더 구조를 게시하십시오. "서버"에서 코드는 어디에 있습니까? – Strelok

답변

1

Java 환경을 먼저 확인하십시오. Java 버전, 클래스 경로 등과 같습니다. 오류는 패키지가 어떤 이유로 인해 가져올 수 없다는 것을 분명하게 나타냅니다.

+0

그래, 나는 서버 폴더를 GWT module.xml 파일에 포함시켰다. 그것은 GWT 컴파일러가 서버 사이드 코드도 컴파일하도록 만들었습니다. – user855

관련 문제