Solved

Having problem converting String to Long

Posted on 2007-11-29
3
3,228 Views
Last Modified: 2013-11-24
I am setting a property in a useBean
and I need to convert String to Long

but get the following exception

JSPG0122E: Unable to parse EL function ${Long.parseLong(orderObject)}.

      at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.validateElFunction(ValidateVisitor.java:1298)

<wcbase:useBean id="orderShippingModeList" classname="com.allenedmonds.commerce.order.beans.OrderShippingModeListDataBean">

	<c:set target="${orderShippingModeList}" property="orderId" value="${Long.parseLong(orderObject)}"/>

	<c:set target="${orderShippingModeList}" property="calculateShippingCharge" value="true"/>

	<c:set target="${orderShippingModeList}" property="calculateShippingAdjustment" value="true"/>

	<c:set target="${orderShippingModeList}" property="resolveFulfillmentCenter" value="false"/>

</wcbase:useBean>

Open in new window

0
Comment
Question by:royalcyber
3 Comments
 
LVL 20

Expert Comment

by:gatorvip
ID: 20384650
Check the value of orderObject to ensure that you're passing a proper value
0
 
LVL 8

Expert Comment

by:mhunts
ID: 20394004
You need to cast to String, as in

Long.parseLong((String) orderObject)
0
 
LVL 1

Accepted Solution

by:
cypher_punk earned 250 total points
ID: 20394972
hi,
try  this:

String str;
Long l;
l = Long.parseLong(str);

It will work...
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now