• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

strtus2: howto validate a form where not all fields are mandatory?

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

Below I have a class name entity (name, address, type...)
The end-user provides some information but not all fields are mandatory.

Q: how can I have 'name' and 'address' to be mandatory but 'type' can be left out? (using annotation)

thanks!



@Validation
public class CustomizeAction extends BaseSupport
{
private Entity entity = new Entity();
.
.
.
public Entity getEntity()
{
return entity;
}

/// WHAT COMES HERE ?!?
public void setEntity(Entity entity)
{
this.entity = entity;
}
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic