M
marcussilfver
I am trying to call a Java method from a JSP script.
This is the Java code
package my_package;
import java.io.*;
public class CountUsers
{
public CountUsers()
{
}
public void logUsers(String fileName, String content)
{
//some code
}
}
This is some of the JSP code:
<%@ page import="my_package.CountUsers" %>
<jsp:useBean id="countUsers" scope="session"
class="my_package.CountUsers"/>
RESULT:
When loading the JSP page, I get an error saying: The value for the
useBean class attribute my_package.CountUsers is invalid.
QUESTION:
Do I have to place my java class in some specific folder for the JSP
to find it?
I am using Tomcat 6 on the server by the way.
This is the Java code
package my_package;
import java.io.*;
public class CountUsers
{
public CountUsers()
{
}
public void logUsers(String fileName, String content)
{
//some code
}
}
This is some of the JSP code:
<%@ page import="my_package.CountUsers" %>
<jsp:useBean id="countUsers" scope="session"
class="my_package.CountUsers"/>
RESULT:
When loading the JSP page, I get an error saying: The value for the
useBean class attribute my_package.CountUsers is invalid.
QUESTION:
Do I have to place my java class in some specific folder for the JSP
to find it?
I am using Tomcat 6 on the server by the way.