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.
Mark Space - 18 Mar 2008 21:31 GMT
> 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.
I think Todd answered this in your previous thread. I use deployers and
I forget how to do things manually sometimes, so it was harder for me to
remember how exactly this should work.
You seriously need to look at a basic tutorial or reference on JSP if
you don't know where to find answers like this. I'd recommend _Head
First JSP and Servlets_ by O'Reilly, it covers all the basics and also
gives you a good overview of all parts of the JEE spec.
Sun also has some online tutorials, but those are harder to follow, in
my opinion.