Last active
November 6, 2016 22:40
-
-
Save zeal7s/f1a265a437c3e9f58d37f9cfc3e51186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////IndexController.java///////////////// | |
@RequestMapping("/index") | |
public String index(Map<String, Object> map){ | |
String json = "{\"year\": 2016}"; | |
map.put("json", json); | |
return "index"; | |
} | |
/////////////////////index.jsp///////////////////////// | |
<script type="text/javascript"> | |
window.json = <%=request.getAttribute("json")%>; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment