What to do with lookup entities selected from drop down select ? How to send them to the service lay

Posted by arrages on Stack Overflow See other posts from Stack Overflow or by arrages
Published on 2010-04-21T20:11:56Z Indexed on 2010/04/21 20:13 UTC
Read the original article Hit count: 188

Filed under:
|
|
|

I am developing a spring mvc based application. I have a simple pojo form object, the problem is that many properties will be taked from drop down lists that are populated from lookup entities, so I return the entity ID to the form object.

public NewCarRequestForm {

   private makeId;  // this are selected from a drop down.
   private modelId;
}

Should I just send this lookup entity ID to the service layer? or should I validated that this ID is correct (Somebody can send any random ID through the request) before and how?

Now there is a problem if I want to validated something based on some property of the lookup entity. Do I perform a database lookup of the entity just to perform the validation?

thanks.

© Stack Overflow or respective owner

Related posts about spring-mvc

Related posts about spring