I am using Viewable in my REST environment to display JSPs. But when I am passing parameters through Viewable, I am not able access this parameter in JSP.
I have following code in my java file -
Map<String, Object> map = new HashMap<String, Object>();
map.put("posts", posts);
map.put("name", "satpute");
return new Viewable("/home",map);
I used different options to access this map
parameter in JSP, but this returns null. I have used following ways -
<% String name = (String)request.getAttribute("name"); out.print(name); %>
Returns NULL.
Other way I tried to use it is -
<% String name = (String) pageContext.getAttribute("name"); out.print(name); %>
Returns NULL.
Sorry if this is a very basic question, but I have used request
in JSP with servlet. But I am not able to figure out how to use JSP with Viewable.
Please help.