Метод контроллера Spring:
Код: Выделить всё
@RequestMapping (value="setupDbEdit.htm", method=RequestMethod.GET)
ModelAndView setupABC(@RequestParam String db_id){
System.out.println("**hello world**"+db_id);
ModelAndView modelAndView=new ModelAndView("editDB");
request.setAttribute("dbID", db_id);
return modelAndView;
}
@RequestMapping (value="editDB.jsp", method=RequestMethod.GET)
ModelAndView addCustomerSetupABC(){
ModelAndView modelAndView= new ModelAndView("editDB");
return modelAndView;
}
Код: Выделить всё
$("#editDb").click(function(e){
$.ajax({
type: 'GET',
'url': 'http://localhost:8080/Test_ReportingUI/setupDbEdit.htm',
data: {db_id: dbID},
dataType: 'html',
success: function(response){
alert(response);
},
timeout: 10000,
error: function(xhr, status, err){
}
});
});
Код: Выделить всё
editDB.jsp
Код: Выделить всё
Insert title here
alert("hellow");
This is edit screen for DB details...
Подробнее здесь: https://stackoverflow.com/questions/353 ... omplete-pa