aspose file tools*
The moose likes Struts and the fly likes Validating domain name with struts validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating domain name with struts validator" Watch "Validating domain name with struts validator" New topic
Author

Validating domain name with struts validator

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Can anyone help me write proper validation for validating a domain name (only SLD), I am trying few things wit RegEx but guess I am not very comfortable with regular expressions now.

The conditions for valid domain mae are as follow -

* Domain Name must be composed of the letters a through z, the numbers 0 through 9, and the hyphen (-) character.
* The Domain Name must not begin or end with the hyphen character.
* The Domain Name must not contain spaces.
* The Domain Name must not contain special characters other than the hyphen character.
* The Domain Name must contain 2 to 63 characters, inclusive.
* Domain Names are not case sensitive.

What should I put in this mask now considering the conditions mentioned above?



TIA,
- Manish
Durgaprasad Guduguntla
Ranch Hand

Joined: Oct 20, 2003
Posts: 99
Try this:


Thanks,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating domain name with struts validator
 
Similar Threads
Issue in validating + symbol
Urgent : Request Help in Struts Special Character Validation
problem in using mask validation
invoking Validation.xml
validation doubt