How about reading the documentation?

http://code.google.com/intl/fr/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideClientSide

The very first paragraph has the answer to your problem and instructs
you to read the following part:
http://code.google.com/intl/fr/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideJavaCompatibility

And ultimately this should precisely answer your question:
http://code.google.com/webtoolkit/doc/1.6/RefJreEmulation.html

=>There is no java.util.regex support in client-side code. You should
use instead:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#matches(java.lang.String)

If there's anything there that's not clear enough, feel free to ask
for clarifications.

Salvador

On 18 mai, 15:10, poonam <[email protected]> wrote:
> Hello,
>     I have developed an Validation application.And in that having
> different classes for Numeric Field, Alphabetic Field, Pattern
> Matching, etc.
> But when I import -
>  import java.util.regex.Matcher;
>  import java.util.regex.Pattern;
> I get errors as -
> The import java.util.regex cannot be resolved
> but,Pattern Matching is the requirement of the classes,
> I have send the class and detailed error message below.Please help or
> suggest what can I do?
> -----class -----
> public class NumericField implements Validation {
> public boolean validate() {
>
>     if(widgetToValidate.getText()!= "[0-9]") {
>         GWT.log("in validate() of RequiredField  ",null);
>
>          String regex = "[0-9]";
>          Pattern p = Pattern.compile(regex,Pattern.CASE_INSENSITIVE);
>          Matcher matcher = p.matcher(regex);
>          //boolean b = m.matches();
>
>                  if(matcher.find())
>         {
>                 Window.alert("correct format");
>         }
>         return false;
>         }
>         return true;
>
>         }
>         }
>
> When I compile this program I get the errors below :
>
> D:\Validation>StudentInfo-compile
> Analyzing source in module 'com.company.StudentInfo'
>    [ERROR] Errors in 'D:\Validation\src\com\company\client
> \Alpahabetic.java'
>       [ERROR] Line 8:  The import java.util.regex cannot be resolved
>       [ERROR] Line 131:  PatternSyntaxException cannot be resolved to
> a type
>       [ERROR] Line 132:  ex cannot be resolved
>    [ERROR] Errors in 'D:\Validation\src\com\company\client
> \NumericField.java'
>       [ERROR] Line 5:  The import java.util.regex cannot be resolved
>       [ERROR] Line 6:  The import java.util.regex cannot be resolved
>       [ERROR] Line 73:  Pattern.CASE_INSENSITIVE cannot be resolved
>       [ERROR] Line 74:  Matcher cannot be resolved to a type
>       [ERROR] Line 74:  The method matcher(String) is undefined for
> the type Pattern
> Finding entry point classes
>    [ERROR] Unable to find type 'com.company.client.StudentInfo'
>       [ERROR] Hint: Previous compiler errors may have made this type
> unavailable
>       [ERROR] Hint: Check the inheritance chain from your module; it
> may not be inheriting a required module or a module
>  may not be adding its source path entries properly
> [ERROR] Build failed
>
> Thus, I am not able to solve the error : The import java.util.regex
> cannot be resolved
>
> How to solve it?
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to