On 5/24/02 7:39 AM, "Eric Everman" <[EMAIL PROTECTED]> wrote:

> Could this be a package issue as well (see Tomcat can't find my
> classes)?  Classes places in the /classes folder must be in nested folders
> matching the package name.  When you reference this class, you must use the
> package name, for instance:
> 
> <jsp:useBean id="user" class="mypackage.userclasses.UserData"
> scope="session"/>

I sent like three responses to this yesterday.

I'll paste them in until people get sick of this, or this problem goes away.

> Eric

fillup

-----------------
>> From the error message, your class LogonData is part of the
> "org.apache.jsp" packages.
> If that is right, you will need to put the class file LogonData.class in c:
> \tomcat\webapps\ROOT\WEB_INF\classes\org\apache\jsp

Sorry to be a pedant, but this is not true.  Tomcat looks for classes that
don't "have" a package home in the tomcat default jsp package -- which is
org.apache.jsp .  This is why you either need to explicitly import the
classes before you use them or put them in your own packages to avoid this
problem altogether.

See my answer of about 5 minutes ago.

cheers
fillup

----------------------------------

you need to import the bean before you can use it - finally remembered this.
it's been discussed a lot on this list.  i think -- or maybe i'm remembering
something else.

try making a line at the top of your jsp that says:
<%@ page language="java" contentType="text/html" import="LogonData" %>

If you put your classes in packages this doesn't happen, AFAIK.

fillup


On 5/24/02 7:39 AM, "Eric Everman" <[EMAIL PROTECTED]> wrote:

> Could this be a package issue as well (see Tomcat can't find my
> classes)?  Classes places in the /classes folder must be in nested folders
> matching the package name.  When you reference this class, you must use the
> package name, for instance:
> 
> <jsp:useBean id="user" class="mypackage.userclasses.UserData"
> scope="session"/>
> 
> 
> Eric
> 
> 
> 
> At 02:30 AM 5/24/2002, you wrote:
>> I have the same problem of other, I read a some tutorial too and...
>> public class UserData {
>>     String username;
>>     String email;
>>     int age;
>> 
>>     public void setUsername( String value )
>>     {...
>> I put in UserData.java and compiled and put in the same directory
>> \WEB-INF\classes, and when
>>  call
>> I find this and compiled and put in the same directory \WEB-INF\classes, and
>> when call
>> SaveName.jsp
>> <jsp:useBean id="user" class="UserData" scope="session"/><jsp:setProperty
>> name="user" property="*"/>
>> receive this error:
>> org.apache.jasper.JasperException: Unable to compile class for JSP
>> 
>> An error occurred at line: 1 in the jsp file: /SaveName.jsp
>> 
>> Generated servlet error:
>> C:\Program Files\Apache Tomcat 4.0\work\localhost\_\SaveName$jsp.java:56:
>> Class org.apache.jsp.UserData not found.
>>                 UserData user = null;
>>                 ^
>> 
>> Why?
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to