What i am asking is in your example, var someStringValue is a String.But I
have to convert it into a long to use in another custom tag method call
which uses a long parameter instead of String.That is why i want to convert
the String someStringValue to a long someLongvalue.



-----Original Message-----
From: Hookom, Jacob [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 2:01 PM
To: Struts Users Mailing List
Subject: RE: convert String to Long


With jstl, unless you are using JSP 2.0 spec with functions, there really
aren't any types... it automatically coaxes the variables to values to match
the appropriate setter.

<c:set value="${currentPath.entity['A'].key}" var="someValue" scope="page"
/>

-----Original Message-----
From: Balakrishnan, Vijay [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 22, 2004 4:00 PM
To: 'Struts Users Mailing List'
Subject: RE: convert String to Long

What i want to do is convert the String to a long actually.How can i do that
in jstl ?In your example, how do i do Long.valueof("7654321") in jstl ?



-----Original Message-----
From: Smith, Darrin [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 1:42 PM
To: 'Struts Users Mailing List'
Subject: RE: convert String to Long


I must be missing something, but if you have the string, and you know it is
a long (a valid integer number), why don't you just use the static valueOf
method?

For example, Long myLong = Long.valueOf("7654321");

Of course, 7654321 will be replaced with your string variable.

-----Original Message-----
From: Balakrishnan, Vijay [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 3:32 PM
To: 'Struts Users Mailing List'
Subject: convert String to Long


Hi,

I want to code a conversion of String to Long as done in the jsp:scriplet
using jstl:

<c:set var="itemIdA" value="currentPath.entityA.key" />
    
    <jsp:scriptlet>
    try
    {
        Long tempLong = new
Long(((PathProxy)currentPath).getEntityA().getKey());
        pageContext.setAttribute("itemIdA", tempLong);
    }

How would i do that in jstl ?
TIA,
Vijay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to