Arindam Saha
Arindam Saha

Reputation: 31

Spring MVC - Dynamic drop down

I know in .NET we can use onChange method. So when we select one drop down, based on that we can populate other.I want to know in Spring MVC can I use anything like that so that I can call a function and connect with DB to retrieve the data?

Upvotes: 0

Views: 504

Answers (1)

Saahon
Saahon

Reputation: 419

if you create a web application then you can do it with the aid of angular+spring. For get a value from select box html with angular: https://docs.angularjs.org/api/ng/directive/select .

for send selected option to javaController with angularjs:

$socpe.onChange = function(item){
  $http.post("/link/toController",item).succes(function(){alert("Success");}).error(function(){alert("Error");}; )};

the Java Controller should be create model, repository and controller, for that you can be used jhipster: http://jhipster.github.io/development.html

Upvotes: 3

Related Questions