aspose file tools*
The moose likes JSP and the fly likes JSTL c:out not working but other commands working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL c:out not working but other commands working" Watch "JSTL c:out not working but other commands working" New topic
Author

JSTL c:out not working but other commands working

Anand Athinarayanan
Greenhorn

Joined: May 20, 2011
Posts: 27
Hi,

I have a problem in dislaying values using the JSTL <c:out> tag. I have a request scoped attribute which is a arraylist containing objects. The objects has properties (corresponding getter setters) which is to be displayed in the jsp page. It is in the display part that I face the issue.

I'm able to retrieve the objects from the list because when I used a <c:if to check for a condition it is working perfectly.

<c:forEach var ="foo" items="{list}"> Assume that list is a arraylist containing bar objects which has properties name and id.

Now when I do this
<c:out value="{foo.name}"> </c:out>. In my JSP it prints foo.name instead of the value of the name but if i do this "{foo.name}" it correctly prints the value of the name say John or whatever.

What am i doing wrong here?

My jsp is deployed on a weblogic 9.2 server, I'm using JSTL 1.1 , so I have both jstl.jar and standard.jar in web-inf/lib. My web.xml is also defined as per the JEE 1.4 specification.
I have imported this - <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> in my jsp page.

Is it possible that only <c:out> wouldn't work? I fear not but its weird. Any help?


Thanks
Anand



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

You forgot the $:


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Anand Athinarayanan
Greenhorn

Joined: May 20, 2011
Posts: 27
Aah Ha!. Got it now. Thanks Bear. Marking it as resolved
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL c:out not working but other commands working