Ich versuche, ein Modellobjekt aus dem Spring MVC -Controller zurück an die Jquery AJAX -Methode zurückzugeben, aber es kehrt leer als Antwort < /p>
JSP: < /p> < Br />
$( "#dialog-link10" ).click(function( event ) {
var appname= $("#dialog-link10").text();
alert(appname);
if(appname == 'RS Applications') {
$.ajax({
type : "GET",
url : 'abc.html',
dataType: 'JSON' ,
data:
{"id" : $("#dialog-link10").text()}
,
success : function(data) {
alert('success')
alert('data')
}
});}
< /code>
Controller: < /p>
@RequestMapping(method=RequestMethod.GET, value="/abc")
@ResponseBody
public Model helloWorld2( @RequestParam("id") String id, Model model) {
System.out.println("*****"+id);
List list1=new ArrayList();
List list2=new ArrayList();
System.out.println("here");
list1.add("abc");
list1.add("abc2");
list1.add("abc3");
list1.add("abc4");
model.addAttribute("list1", list1);
return model;
}
< /code>
Dies generiert auch keine Erfolgswarnung.>
Rückkehrmodellobjekt von Controller zu Ajax JQuery funktioniert nicht im Frühjahr MVC ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Wie rufe ich einen Controller von einem anderen Controller in Codesigniter auf?
by Anonymous » » in Php - 0 Replies
- 17 Views
-
Last post by Anonymous
-