Originally posted by Reghuram Variyam:
'0' will evaluate to "AAAA"
****My Servlet looks like this*******
response.setContentType("text/html");
PrintWriter out = response.getWriter();
request.setAttribute("0", "AAAA");
HashMap map = new HashMap();
map.put("0", "Zero");
map.put("1", "One");
map.put("AAAA", "VVVV");
request.setAttribute("map", map);
RequestDispatcher view = request.getRequestDispatcher("result.jsp");
view.forward(request,response);
**My result.JSP is*************
<html> <body>
<h1 align="center"> From JSP </h1>
<p>
Result from Jsp1: ${map[0]}
<p>
Result from Jsp12: ${map["0"]}
</body>
</html>
*********Result I received is *******
Result from Jsp1:
Result from Jsp12: Zero
*********************************
But I was expecting Result from JSP1 to show "VVVV". Because from ${map[0]}, '0' will evaluate to "AAAA" and then ${map["AAAA"]} will evaluate to "VVVV".
Can some one help me to find out why Iam not getting the result I was expecting ?
Thanks
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Bob N
CSSLP
SCJP - 1.4
SCJD - (B&S) Used 1.5 And It Runs On Solaris10
SCWCD - Thanks to HFSJ!!