tags:

views:

57

answers:

1

I've the following piece of code in the server folder of the module.

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

But I still get the following errors:

[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

I've imported

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

in the code.

I thought that Regex will work on the server side. Why is this not working?

A: 

Check out the Java environment first. Like the Java version, classpath, etc. The error clearly states that the package cannot be imported due to some reason.

shinkou
Yup, I had included the server folder in the GWT module.xml file. That was causing GWT compiler to compile my server side code also.
ajay