0
我知道在.NET中我们可以使用onChange方法。因此,当我们选择一个下拉列表时,基于此我们可以填充other.I想知道在Spring MVC中,我可以使用类似的东西,以便我可以调用一个函数并与DB连接以检索数据?Spring MVC - 动态下拉
我知道在.NET中我们可以使用onChange方法。因此,当我们选择一个下拉列表时,基于此我们可以填充other.I想知道在Spring MVC中,我可以使用类似的东西,以便我可以调用一个函数并与DB连接以检索数据?Spring MVC - 动态下拉
如果你创建一个web应用程序,那么你可以借助角度+弹簧来实现。从角度:https://docs.angularjs.org/api/ng/directive/select从选择框html中获取值。
用于发送所选选项javaController与angularjs:
$socpe.onChange = function(item){
$http.post("/link/toController",item).succes(function(){alert("Success");}).error(function(){alert("Error");};)};
了Java控制器应创建模型,存储库和控制器,对于您可以使用jhipster:http://jhipster.github.io/development.html