File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP Calling Java Method error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Calling Java Method error" Watch "JSP Calling Java Method error" New topic

JSP Calling Java Method error

Aya Tarek

Joined: Apr 13, 2014
Posts: 3
I have a JSP page that calls a Java method .. using GlassFish 4.0 it worked just fine, now I'm trying to run it on a new server with Tomcat 6.0 but it keeps giving me this error:
"the function result must be used with a prefix when a default namespace is not specified"

Here's my JSP page:

<%@ taglib prefix="c" uri="" %>
<jsp:useBean id="diskUtilData" scope="request" class="newpackage.ResultPage" />
<c:forEach var="celldata" items="${diskUtilData.result()}">
<c:forEach var="col" items="${celldata}">
<cut value="${col}" />

Here's my java method:

package newpackage;

public class ResultPage {

public String[][] result() throws FileNotFoundException, IOException{

String[][] res= new String [60][6];

//Some Code

return res;



Netbeans IDE 7.0


Thanks alot
Aya Tarek

Joined: Apr 13, 2014
Posts: 3
I'm sorry I don't get it :S
Souvik Dasgupta
Ranch Hand

Joined: Sep 24, 2009
Posts: 77

Please try the following:

Thanks and Regards, Souvik
Aya Tarek

Joined: Apr 13, 2014
Posts: 3

<c:out value="${fn:diskUtilData.length()}" />

*the line turns to red telling me :

"Encountered ":" at line 1,col 4 was expecting one of : "......." "
It is sorta covered in the JavaRanch Style Guide.
subject: JSP Calling Java Method error
Similar Threads
Accessing an ArrayList of objects in JSP
can't find css, images and js static files
Jstl error
JSTL does not show values
jsp error