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

Discussion in 'Java' started by marcussilfver@gmail.com, Mar 18, 2008.

  1. Guest

    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.
     
    , Mar 18, 2008
    #1
    1. Advertising

  2. Mark Space Guest

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

    wrote:

    > 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.
     
    Mark Space, Mar 18, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DigitalUncle
    Replies:
    0
    Views:
    925
    DigitalUncle
    Nov 2, 2004
  2. Rico
    Replies:
    4
    Views:
    1,524
    kaeli
    Mar 14, 2005
  3. undermemphis
    Replies:
    0
    Views:
    7,892
    undermemphis
    Mar 16, 2006
  4. Replies:
    0
    Views:
    4,419
  5. Nino
    Replies:
    3
    Views:
    2,209
Loading...

Share This Page