簡體   English   中英

正則表達式類不適用於GWT的服務器端

[英]Regex class not working on server side of GWT

我在模塊的服務器文件夾中有以下代碼。

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可以在服務器端工作。 為什么這不起作用?

首先檢查Java環境。 類似於Java版本,類路徑等。該錯誤明確指出由於某種原因無法導入該軟件包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM