wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSLT printing c:out value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSLT printing c:out value" Watch "JSLT printing c:out value" New topic
Author

JSLT printing c:out value

sun ram
Ranch Hand

Joined: Dec 18, 2001
Posts: 61
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
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
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


SCJP1.4<br />SCWCD 1.4 (Beta)<br />SCMAD 1.0 (Beta)<br />SCDJWS (Beta)<br />SCBCD 1.3 <br />SCJD <br />SCEA (Prepairing)<br />"I am mike, not milk"
sun ram
Ranch Hand

Joined: Dec 18, 2001
Posts: 61
Thanks, It worked.
-SR
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSLT printing c:out value