& lt; A href="javascript: void (0)" th: text="${post. The title}" th: onclick="| seeContent (${post. Post_id}) |" & gt;
function seeContent (postId) {
$. Ajax ({
Url: '/msgContent,
Type: "POST",
DataType: 'json,
Data: {: postId postId},
Success: the function (data) {
}
})
}
@ RequestMapping ("/msgContent ")there are output value, but only user_ms. HTML page can not jump the save the children
@ ResponseBody
Public String findMsgContent (String postId, Model mode) {
System. The out. Println (postId);
PostTopic msgContent=postService. FindMsgContent (postId);
System. The out. Println (msgContent);
Mode. The addAttribute (" content ", msgContent);
Return "user_ms. HTML";
}
CodePudding user response:
Don't sink to the individual