Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

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

Thread view: 
marcussilfver@gmail.com - 18 Mar 2008 19:41 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.