aspose file tools*
The moose likes Struts and the fly likes Please Help Me With Converting JSP Scripting Elements To c:set ..  c:out .. Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Please Help Me With Converting JSP Scripting Elements To c:set ..  c:out .. Tags" Watch "Please Help Me With Converting JSP Scripting Elements To c:set ..  c:out .. Tags" New topic
Author

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

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
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
<cut 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 ]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Shouldn't that be something more like

???

(sorry about the graemlin).
[ June 30, 2004: Message edited by: Tim Holloway ]

Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please Help Me With Converting JSP Scripting Elements To c:set .. c:out .. Tags