Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Validation > url validator |
URLValidator checks that a given field is a String and a valid URL
<validators> <!-- Plain Validator Syntax --> <validator type="url"> <param name="fieldName">myHomePage</param> <message>Invalid homepage url</message> </validator> <!-- Field Validator Syntax --> <field name="myHomepage"> <message>Invalid homepage url</message> </field> </validators>