• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Setting Range validators on text fields through Managed Bean declarations

Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers,

I'm new to JSF and trying to learn the concepts through examples. I have an application where I would like to validate the user input on a JSP page. I'm using validateLongRange tag to validate 3 fields. Each field is having a maximum and a minimum value and I want to fetch these values from the faces-config.xml

How do I declare the maximum and minimum ranges in the XML? As there are 3 fields, how to identify the max and min of each field in the XML? Is there a way out for this or do I need to hard-code the max/min values in the JSP page? Can anyone please help me in this regards?

Saloon Keeper
Posts: 25477
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Faces-config wasn't really intended to be used that way. You can add new validators to the system using faces-config, but actual per-instance parameters are expected to appear on the items that actually use them.

You could kind of fake it by subclassing the standard validator, but since faces-config doesn't permit you to add arbitrary XML to itself, the actual values would need to be stored somewhere else.
Poop goes in a willow feeder. Wipe with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic