This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSP and the fly likes JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL" Watch "JSTL" New topic
Author

JSTL

Veeru Singh
Greenhorn

Joined: Dec 19, 2006
Posts: 1
Hi,

Is there any JSTL tag which allows to create a new vairable of both Object and permitive data type.. for example

we can do this with scripting..

<% Integer i=new Integer(45) %>
<% int j=89; %>

but do we have a tag to do the same thing.. can we use <c:set>

please help..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Why would you need a numeric value to be a primitive type?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mukesh Mittal
Ranch Hand

Joined: Jan 13, 2006
Posts: 31
We can either set the value of a scoped variable using <c:set value="value" [scope]/> or set the property of a target object.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

My point is: scoped variables can only be of object types, not primitives. But from the point of view of the JSTL, EL and the rest of the page, who cares?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL
 
Similar Threads
Scriptlets
"tag:useObject"?
Passing values between JSTL and scriptlet
logic:iterate for counter
Passing values between JSTL and scriptlet