Hi, I want to print the hastable name value, but its not working. Here is the code, I want to print name key value. =========== <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.util.*" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <html> <head> <title>c:set test</title> </head> <body> C:Set Test <br> <jsp:useBean id="n" class="java.util.Hashtable" /> <c:set value="name" target="${n}" property="Hello World"/> name values is: <c ut value="${n.name}"/>
</body> </html> ============ I except the out Hello World, But its not printing. Any help? SR
SCSecA,SCNA,SCSA,SCWCD,SCJP
Sam chen
Greenhorn
Joined: Jan 19, 2004
Posts: 3
posted
0
try the following: <jsp:useBean id="n" class="java.util.Hashtable" /> <c:set value="Hello World" target="${n}" property="name" /> name value is: <c ut value="${n.name}" /> I got the Hello World.
OCP 9i, OCA 9i<br />SCJP
Mike Wang
Ranch Hand
Joined: May 09, 2003
Posts: 76
posted
0
1. uri for core is uri="http://java.sun.com/jsp/jstl/core" not uri="http://java.sun.com/jstl/core" as suggested in JSTL spec. 2. with
you put a string ("name") with key ("Hello World") into the Map ${n} if you want to print the value with key "Hello World" you need to use
not
because the there is not key ("name") availible in the map ${n}
btw: is not working
Originally posted by sun ram: Hi, I want to print the hastable name value, but its not working. Here is the code, I want to print name key value. =========== <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.util.*" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <html> <head> <title>c:set test</title> </head> <body> C:Set Test <br> <jsp:useBean id="n" class="java.util.Hashtable" /> <c:set value="name" target="${n}" property="Hello World"/> name values is: <c ut value="${n.name}"/>
</body> </html> ============ I except the out Hello World, But its not printing. Any help? SR