• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Please Help Me With Converting JSP Scripting Elements To c:set .. c:out .. Tags

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am converting all the scripting elements in my JSP to <c:.... > tags. I have decided to go one step at the time -- I only want to print out one basic number as a start.

My action class passes an object "TotalPosts" in the following way to my JSP:

and the following scripting elements in my JSP display the value of TotalPosts well:

Now, I have the struts-html-el.tld downloaded and put the following in my application's web.xml file:

And in my JSP, I imported the following:

I replaced:

int totalPosts = ( ( Integer )request.getAttribute( "TotalPosts" ) ).intValue();
with
<c:set var="totalPosts" value="${requestScope.TotalPosts}" />

And I replaced:

<%=totalPosts%>
with
<c:out value="${requestScope.totalPosts}" />

I cannot print out anything. I got a 'BLANK'.

There must be something I missed. What did go wrong?
[ June 20, 2004: Message edited by: JiaPei Jen ]
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shouldn't that be something more like

???

(sorry about the graemlin).
[ June 30, 2004: Message edited by: Tim Holloway ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic