Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Validation > url validator
Added by tm_jee, last edited by Philip Luppens on Feb 10, 2007  (view change) show comment


URLValidator checks that a given field is a String and a valid URL


  • fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required


         <!-- Plain Validator Syntax -->
         <validator type="url">
             <param name="fieldName">myHomePage</param>
             <message>Invalid homepage url</message>
         <!-- Field Validator Syntax -->
         <field name="myHomepage">
             <message>Invalid homepage url</message>