• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stuts Validation

 
charmy jain
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is possible URL Validation into Struts FrameWork ?



thanks
 
java bab
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i think it's not possible.

thanks.
 
Joseph Erickson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using the Validator, you can use the following validation in your validator.xml


url - validates url format. Has four optional variables (allowallschemes, allow2slashes, nofragments and schemes) which can be used to configure this validator.
  • allowallschemes specifies whether all schemes are allowed. Valid values are true or false (default is false). If this is set to true then the schemes variable is ignored.
  • allow2slashes specifies whether double '/' characters are allowed. Valid values are true or false (default is false).
  • nofragments specifies whether fragements are allowed. Valid values are true or false (default is false - i.e. fragments are allowed).
  • schemes - use to specify a comma separated list of valid schemes. If not specified then the defaults are used which are http, https and ftp.

  • <field property="custUrl" depends="url">
    <arg0 key="customer.url"/>
    </field>

    <field property="custUrl" depends="url">
    <arg0 key="customer.url"/>
    <var>
    <var-name>nofragments</var-name>
    <var-value>true</var-value>
    </var>
    <var>
    <var-name>schemes</var-name>
    <var-value>http,https,telnet,file</var-value>
    </var>
    </field>

    http://struts.apache.org/struts-doc-1.2.4/userGuide/dev_validator.html

    [ May 10, 2006: Message edited by: Joseph Erickson ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic