• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP Calling Java Method error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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="http://java.sun.com/jsp/jstl/core" %>
......
<jsp:useBean id="diskUtilData" scope="request" class="newpackage.ResultPage" />
.....
<c:forEach var="celldata" items="${diskUtilData.result()}">
<tr>
<c:forEach var="col" items="${celldata}">
<td>
<c:out value="${col}" />
</td>
</c:forEach>
</tr>
</c:forEach>
-------------------------------------------------------------------------------

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;
}

/////////////////////

Folders:
NetBeansProjects\JSP\web\WEB-INF/lib/jstl-1.2.jar
NetBeansProjects\JSP\web\WEB-INF/lib/standard-1.1.2.jar

Netbeans IDE 7.0


----------------

Thanks alot
 
Aya Tarek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sorry I don't get it :S
 
Ranch Hand
Posts: 113
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Please try the following:

 
Aya Tarek
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

*the line turns to red telling me :

"Encountered ":" at line 1,col 4 was expecting one of : "......." "
 
Hang a left on main. Then read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic