Getting "The value for the useBean class attribute is invalid" errorwhen loading JSP page

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.
 
M

Mark Space

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top