aspose file tools*
The moose likes Struts and the fly likes strtus2: howto validate a form  where not all fields are mandatory? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "strtus2: howto validate a form  where not all fields are mandatory?" Watch "strtus2: howto validate a form  where not all fields are mandatory?" New topic
Author

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

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
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;
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: strtus2: howto validate a form where not all fields are mandatory?